Add a convenience script to start msysGit in WINE
[msysgit.git] / mingw / doc / gdb / PORTPATCH
blobc05e77aa7f6c47c4b64e03c71ccd0f49cae3af5b
1 Index: configure.in
2 ===================================================================
3 RCS file: /prjz/.cvsroot/gdb/configure.in,v
4 retrieving revision 1.1.1.1
5 diff -u -3 -p -r1.1.1.1 configure.in
6 --- configure.in        2003/02/16 21:33:17     1.1.1.1
7 +++ configure.in        2003/02/16 22:03:19
8 @@ -752,10 +752,10 @@ case "${target}" in
9      target_configdirs="$target_configdirs target-mingw"
10      noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
12 -    # Can't build gdb for mingw32 if not native.
13 +    # Can't build some things for mingw32 if not native.
14      case "${host}" in
15 -      i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
16 -      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
17 +      i[3456]86-*-mingw32) ;; # keep tcl tk expect etc.
18 +      *) noconfigdirs="$noconfigdirs tcl tk expect itcl tix db snavigator gnuserv"
19           ;;
20      esac
21      ;;    
22 Index: bfd/opncls.c
23 ===================================================================
24 RCS file: /prjz/.cvsroot/gdb/bfd/opncls.c,v
25 retrieving revision 1.1.1.1
26 diff -u -3 -p -r1.1.1.1 opncls.c
27 --- bfd/opncls.c        2003/02/16 21:33:43     1.1.1.1
28 +++ bfd/opncls.c        2003/02/16 22:03:19
29 @@ -218,7 +218,18 @@ bfd_fdopenr (filename, target, fd)
31    bfd_set_error (bfd_error_system_call);
32  #if ! defined(HAVE_FCNTL) || ! defined(F_GETFL)
33 +#ifdef __MINGW32__
34 +  /* If we wrongly guess the access type on mingw, later in bfd_open_file
35 +     fopen will fail trying to open currently executing file in +r mode. */
36 +     
37 +  /* I can't find a better way to determine which way fd was opened. */
38 +  if ( _commit( fd) < 0)
39 +    fdflags = O_RDONLY;
40 +  else
41 +    fdflags = O_RDWR;
42 +#else
43    fdflags = O_RDWR;                    /* Assume full access */
44 +#endif
45  #else
46    fdflags = fcntl (fd, F_GETFL, NULL);
47  #endif
48 Index: gdb/Makefile.in
49 ===================================================================
50 RCS file: /prjz/.cvsroot/gdb/gdb/Makefile.in,v
51 retrieving revision 1.1.1.1
52 diff -u -3 -p -r1.1.1.1 Makefile.in
53 --- gdb/Makefile.in     2003/02/16 21:34:20     1.1.1.1
54 +++ gdb/Makefile.in     2003/02/16 22:03:17
55 @@ -1204,7 +1204,7 @@ ALLDEPFILES = 29k-share/udi/udip2soc.c 2
56         remote-udi.c remote-vx.c remote-vx29k.c \
57         rs6000-nat.c rs6000-tdep.c \
58         s390-tdep.c s390-nat.c \
59 -       ser-go32.c ser-pipe.c ser-tcp.c \
60 +       ser-go32.c ser-pipe.c ser-tcp.c ser-dummy.c \
61         sh-tdep.c solib.c solib-svr4.c solib-sunos.c sparc-linux-nat.c \
62         sparc-nat.c \
63         sparc-tdep.c sparcl-tdep.c sun3-nat.c \
64 @@ -2000,6 +2000,8 @@ ser-pipe.o: ser-pipe.c $(defs_h) $(seria
65  ser-tcp.o: ser-tcp.c $(defs_h) $(serial_h) $(gdb_string_h) $(ser_unix_h)
67  ser-unix.o: ser-unix.c $(defs_h) $(serial_h) $(ser_unix_h) 
69 +ser-dummy.o: ser-dummy.c $(defs_h) $(serial_h)
71  serial.o: serial.c $(defs_h) $(serial_h) $(gdb_string_h)
73 Index: gdb/configure
74 ===================================================================
75 RCS file: /prjz/.cvsroot/gdb/gdb/configure,v
76 retrieving revision 1.1.1.1
77 diff -u -3 -p -r1.1.1.1 configure
78 --- gdb/configure       2003/02/16 21:34:02     1.1.1.1
79 +++ gdb/configure       2003/02/16 22:03:17
80 @@ -6836,10 +6836,40 @@ fi
81  echo "$ac_t""$gdb_cv_os_cygwin" 1>&6
84 +# In the MinGW environment, we need some additional flags.
85 +echo $ac_n "checking for mingw""... $ac_c" 1>&6
86 +echo "configure:6813: checking for mingw" >&5
87 +if eval "test \"`echo '$''{'gdb_cv_os_mingw'+set}'`\" = set"; then
88 +  echo $ac_n "(cached) $ac_c" 1>&6
89 +else
90 +  cat > conftest.$ac_ext <<EOF
91 +#line 6818 "configure"
92 +#include "confdefs.h"
94 +#if defined (__MINGW__) || defined (__MINGW32__)
95 +lose
96 +#endif
97 +EOF
98 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
99 +  egrep "lose" >/dev/null 2>&1; then
100 +  rm -rf conftest*
101 +  gdb_cv_os_mingw=yes
102 +else
103 +  rm -rf conftest*
104 +  gdb_cv_os_mingw=no
106 +rm -f conftest*
110 +echo "$ac_t""$gdb_cv_os_mingw" 1>&6
113  SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
114  case ${host} in
115    *go32* ) SER_HARDWIRE=ser-go32.o ;;
116    *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
117 +  *mingw* ) SER_HARDWIRE=ser-dummy.o ;;
118  esac
121 @@ -7102,7 +7132,7 @@ fi
123  # libreadline needs libuser32.a in a cygwin environment
124  WIN32LIBS=
125 -if test x$gdb_cv_os_cygwin = xyes; then
126 +if test x$gdb_cv_os_cygwin = xyes || test x$gdb_cv_os_mingw = xyes; then
127      WIN32LIBS="-luser32"
128      case "${target}" in
129         *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
130 @@ -7181,7 +7211,7 @@ else
131    
132  # Default is on for everything but go32 and Cygwin
133  case "$host" in
134 -    *go32* | *windows*)
135 +    *go32* | *windows* | *mingw* )
136         ;;
137      *)
138         if test -d "${srcdir}/gdbtk" ; then
139 @@ -8119,7 +8149,7 @@ fi
140            CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
141            CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
143 -          if test x$gdb_cv_os_cygwin = xyes; then
144 +          if test x$gdb_cv_os_cygwin = xyes || test x$gdb_cv_os_mingw = xyes; then
145               WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
146               WIN32LDAPP="-Wl,--subsystem,console"
147               CONFIG_OBS="${CONFIG_OBS} gdbres.o"
148 Index: gdb/configure.host
149 ===================================================================
150 RCS file: /prjz/.cvsroot/gdb/gdb/configure.host,v
151 retrieving revision 1.1.1.1
152 diff -u -3 -p -r1.1.1.1 configure.host
153 --- gdb/configure.host  2003/02/16 21:34:03     1.1.1.1
154 +++ gdb/configure.host  2003/02/16 22:03:17
155 @@ -81,6 +81,7 @@ i[3456]86-*-unixware*)        gdb_host=i386v4 ;
156  i[3456]86-*-sysv*)     gdb_host=i386v ;;
157  i[3456]86-*-isc*)      gdb_host=i386v32 ;;
158  i[3456]86-*-cygwin*)   gdb_host=cygwin ;;
159 +i[3456]86-*-mingw32*)  gdb_host=mingw32 ;;
161  ia64-*-aix*)           gdb_host=aix ;;
162  ia64-*-linux*)         gdb_host=linux ;;
163 Index: gdb/configure.in
164 ===================================================================
165 RCS file: /prjz/.cvsroot/gdb/gdb/configure.in,v
166 retrieving revision 1.1.1.1
167 diff -u -3 -p -r1.1.1.1 configure.in
168 --- gdb/configure.in    2003/02/16 21:34:03     1.1.1.1
169 +++ gdb/configure.in    2003/02/16 22:03:17
170 @@ -847,12 +847,20 @@ AC_CACHE_CHECK([for cygwin], gdb_cv_os_c
171  lose
172  #endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
174 +# Ditto for MinGW
175 +AC_CACHE_CHECK([for mingw], gdb_cv_os_mingw,
176 +[AC_EGREP_CPP(lose, [
177 +#if defined (__MINGW__) || defined (__MINGW32__)
178 +lose
179 +#endif],[gdb_cv_os_mingw=yes],[gdb_cv_os_mingw=no])])
182  dnl Figure out which of the many generic ser-*.c files the _host_ supports.
183  SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
184  case ${host} in
185    *go32* ) SER_HARDWIRE=ser-go32.o ;;
186    *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
187 +  *mingw* ) SER_HARDWIRE=ser-dummy.o ;;
188  esac
189  AC_SUBST(SER_HARDWIRE)
191 @@ -882,7 +890,7 @@ AC_SUBST(TERM_LIB)
193  # libreadline needs libuser32.a in a cygwin environment
194  WIN32LIBS=
195 -if test x$gdb_cv_os_cygwin = xyes; then
196 +if test x$gdb_cv_os_cygwin = xyes || test x$gdb_cv_os_mingw = xyes; then
197      WIN32LIBS="-luser32"
198      case "${target}" in
199         *cygwin*) WIN32LIBS="$WIN32LIBS -limagehlp"
200 @@ -951,9 +959,9 @@ AC_ARG_ENABLE(gdbtk,
201         AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
202  esac],
204 -# Default is on for everything but go32 and Cygwin
205 +# Default is on for everything but go32, MinGW and Cygwin
206  case "$host" in
207 -    *go32* | *windows*)
208 +    *go32* | *windows* | *mingw* )
209         ;;
210      *)
211         if test -d "${srcdir}/gdbtk" ; then
212 @@ -1078,7 +1086,7 @@ if test "${enable_gdbtk}" = "yes"; then
213            CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_GDBTK_INSTALL)"
214            CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_GDBTK_UNINSTALL)"
216 -          if test x$gdb_cv_os_cygwin = xyes; then
217 +          if test x$gdb_cv_os_cygwin = xyes || test x$gdb_cv_os_mingw = xyes; then
218               WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
219               WIN32LDAPP="-Wl,--subsystem,console"
220               CONFIG_OBS="${CONFIG_OBS} gdbres.o"
221 Index: gdb/configure.tgt
222 ===================================================================
223 RCS file: /prjz/.cvsroot/gdb/gdb/configure.tgt,v
224 retrieving revision 1.1.1.1
225 diff -u -3 -p -r1.1.1.1 configure.tgt
226 --- gdb/configure.tgt   2003/02/16 21:34:03     1.1.1.1
227 +++ gdb/configure.tgt   2003/02/16 22:03:17
228 @@ -126,6 +126,7 @@ i[3456]86-*-netware*)       gdb_target=i386nw
229                 configdirs="${configdirs} nlm" ;;
230  i[3456]86-*-osf1mk*)   gdb_target=i386mk ;;
231  i[3456]86-*-cygwin*)   gdb_target=cygwin  ;;
232 +i[3456]86-*-mingw32*)  gdb_target=mingw32  ;;
233  i[3456]86-*-pe*)       gdb_target=embed  ;;
234  i[3456]86-*-vxworks*)  gdb_target=vxworks ;;
236 Index: gdb/defs.h
237 ===================================================================
238 RCS file: /prjz/.cvsroot/gdb/gdb/defs.h,v
239 retrieving revision 1.1.1.1
240 diff -u -3 -p -r1.1.1.1 defs.h
241 --- gdb/defs.h  2003/02/16 21:34:05     1.1.1.1
242 +++ gdb/defs.h  2003/02/16 22:03:19
243 @@ -810,9 +810,13 @@ enum lval_type
245  struct frame_info;
247 -/* From readline (but not in any readline .h files).  */
248 +#ifndef __MINGW32__
249 +  /* From readline (but not in any readline .h files).  */
251 -extern char *tilde_expand (char *);
252 +  extern char *tilde_expand (char *);
253 +#else
254 +  /* readline 4.2 ported to MinGW does have this. */
255 +#endif
257  /* Control types for commands */
259 @@ -1363,7 +1367,7 @@ extern int use_windows;
260  #define SLASH_STRING "/"
261  #endif
263 -#ifdef __MSDOS__
264 +#if defined(__MSDOS__) || defined(__MINGW32__)
265  # define CANT_FORK
266  # define GLOBAL_CURDIR
267  #endif
268 Index: gdb/environ.c
269 ===================================================================
270 RCS file: /prjz/.cvsroot/gdb/gdb/environ.c,v
271 retrieving revision 1.1.1.1
272 diff -u -3 -p -r1.1.1.1 environ.c
273 --- gdb/environ.c       2003/02/16 21:34:07     1.1.1.1
274 +++ gdb/environ.c       2003/02/16 22:03:18
275 @@ -27,12 +27,12 @@
277  /* Return a new environment object.  */
279 -struct environ *
280 +struct gdb_environ *
281  make_environ (void)
283 -  register struct environ *e;
284 +  register struct gdb_environ *e;
286 -  e = (struct environ *) xmalloc (sizeof (struct environ));
287 +  e = (struct gdb_environ *) xmalloc (sizeof (struct gdb_environ));
289    e->allocated = 10;
290    e->vector = (char **) xmalloc ((e->allocated + 1) * sizeof (char *));
291 @@ -43,7 +43,7 @@ make_environ (void)
292  /* Free an environment and all the strings in it.  */
294  void
295 -free_environ (register struct environ *e)
296 +free_environ (register struct gdb_environ *e)
298    register char **vector = e->vector;
300 @@ -58,7 +58,7 @@ free_environ (register struct environ *e
301     that all strings in these environments are safe to free.  */
303  void
304 -init_environ (register struct environ *e)
305 +init_environ (register struct gdb_environ *e)
307    extern char **environ;
308    register int i;
309 @@ -90,7 +90,7 @@ init_environ (register struct environ *e
310     This is used to get something to pass to execve.  */
312  char **
313 -environ_vector (struct environ *e)
314 +environ_vector (struct gdb_environ *e)
316    return e->vector;
318 @@ -98,7 +98,7 @@ environ_vector (struct environ *e)
319  /* Return the value in environment E of variable VAR.  */
321  char *
322 -get_in_environ (const struct environ *e, const char *var)
323 +get_in_environ (const struct gdb_environ *e, const char *var)
325    register int len = strlen (var);
326    register char **vector = e->vector;
327 @@ -114,7 +114,7 @@ get_in_environ (const struct environ *e,
328  /* Store the value in E of VAR as VALUE.  */
330  void
331 -set_in_environ (struct environ *e, const char *var, const char *value)
332 +set_in_environ (struct gdb_environ *e, const char *var, const char *value)
334    register int i;
335    register int len = strlen (var);
336 @@ -161,7 +161,7 @@ set_in_environ (struct environ *e, const
337  /* Remove the setting for variable VAR from environment E.  */
339  void
340 -unset_in_environ (struct environ *e, char *var)
341 +unset_in_environ (struct gdb_environ *e, char *var)
343    register int len = strlen (var);
344    register char **vector = e->vector;
345 Index: gdb/environ.h
346 ===================================================================
347 RCS file: /prjz/.cvsroot/gdb/gdb/environ.h,v
348 retrieving revision 1.1.1.1
349 diff -u -3 -p -r1.1.1.1 environ.h
350 --- gdb/environ.h       2003/02/16 21:34:07     1.1.1.1
351 +++ gdb/environ.h       2003/02/16 22:03:18
352 @@ -21,7 +21,7 @@
354  /* We manipulate environments represented as these structures.  */
356 -struct environ
357 +struct gdb_environ
358    {
359      /* Number of usable slots allocated in VECTOR.
360         VECTOR always has one slot not counted here,
361 @@ -34,18 +34,18 @@ struct environ
362      char **vector;
363    };
365 -extern struct environ *make_environ (void);
366 +extern struct gdb_environ *make_environ (void);
368 -extern void free_environ (struct environ *);
369 +extern void free_environ (struct gdb_environ *);
371 -extern void init_environ (struct environ *);
372 +extern void init_environ (struct gdb_environ *);
374 -extern char *get_in_environ (const struct environ *, const char *);
375 +extern char *get_in_environ (const struct gdb_environ *, const char *);
377 -extern void set_in_environ (struct environ *, const char *, const char *);
378 +extern void set_in_environ (struct gdb_environ *, const char *, const char *);
380 -extern void unset_in_environ (struct environ *, char *);
381 +extern void unset_in_environ (struct gdb_environ *, char *);
383 -extern char **environ_vector (struct environ *);
384 +extern char **environ_vector (struct gdb_environ *);
386  #endif /* defined (ENVIRON_H) */
387 Index: gdb/event-loop.c
388 ===================================================================
389 RCS file: /prjz/.cvsroot/gdb/gdb/event-loop.c,v
390 retrieving revision 1.1.1.1
391 diff -u -3 -p -r1.1.1.1 event-loop.c
392 --- gdb/event-loop.c    2003/02/16 21:34:07     1.1.1.1
393 +++ gdb/event-loop.c    2003/02/16 22:03:18
394 @@ -36,6 +36,15 @@
395  #include <errno.h>
396  #include <sys/time.h>
398 +#ifdef __MINGW32__
399 +#include <io.h>
400 +#include <mingw-gettimeofday.h>
401 +/* Define this to avoid including winsock.h from windows.h - this is really
402 +   fragile! */
403 +#define WIN32_LEAN_AND_MEAN
404 +#include <windows.h>
405 +#endif
407  typedef struct gdb_event gdb_event;
408  typedef void (event_handler_func) (int);
410 @@ -145,12 +154,23 @@ static struct
411      int poll_timeout;
412  #endif
414 +#ifdef __MINGW32__
415 +    /* Handles for WaitForMultipleObjects.
417 +       Space is allocated for num_fds handles, but currently only console
418 +       input handles are waited upon, all other handle kinds are
419 +       considered always ready. */
421 +    HANDLE *waitable_handles;
422 +    file_handler **waitable_files;
423 +#else
424      /* Masks to be used in the next call to select.
425         Bits are set in response to calls to create_file_handler. */
426      fd_set check_masks[3];
428      /* What file descriptors were found ready by select. */
429      fd_set ready_masks[3];
430 +#endif
432      /* Number of file descriptors to monitor. (for poll) */
433      /* Number of valid bits (highest fd value + 1). (for select) */
434 @@ -458,7 +478,13 @@ add_file_handler (int fd, handler_func *
435  #endif
436      }
437    else
438 +#ifdef __MINGW32__
439 +    /* For now, there is no way to specify a mask for users of
440 +       create_file_handler under MinGW. */
441 +    create_file_handler (fd, 0, proc, client_data);
442 +#else
443      create_file_handler (fd, GDB_READABLE | GDB_EXCEPTION, proc, client_data);
444 +#endif
447  /* Add a file handler/descriptor to the list of descriptors we are
448 @@ -521,6 +547,38 @@ create_file_handler (int fd, int mask, h
449      }
450    else
451      {
452 +#ifdef __MINGW32__
453 +      /* Count number of file_handlers, realloc space if needed */
455 +      int count_fds = 0;
457 +      for (file_ptr = gdb_notifier.first_file_handler; file_ptr != NULL;
458 +           file_ptr = file_ptr->next_file)
459 +        count_fds++;
460 +      
461 +      if( gdb_notifier.num_fds != count_fds)
462 +      {
463 +        if( gdb_notifier.num_fds == 0)
464 +       {
465 +         gdb_notifier.waitable_handles = 
466 +           (HANDLE *)xmalloc( sizeof( HANDLE));
467 +         gdb_notifier.waitable_files = 
468 +           (file_handler **)xmalloc( sizeof( file_handler *));
469 +       }
470 +       else
471 +       {
472 +         gdb_notifier.waitable_handles = 
473 +           (HANDLE *)xrealloc( 
474 +             gdb_notifier.waitable_handles, count_fds * sizeof( HANDLE)
475 +           );
476 +         gdb_notifier.waitable_files = 
477 +           (file_handler **)xrealloc( 
478 +             gdb_notifier.waitable_files, count_fds * sizeof( file_handler *)
479 +           );
480 +       }
481 +       gdb_notifier.num_fds = count_fds;
482 +      }
483 +#else
484        if (mask & GDB_READABLE)
485         FD_SET (fd, &gdb_notifier.check_masks[0]);
486        else
487 @@ -538,6 +596,7 @@ create_file_handler (int fd, int mask, h
489        if (gdb_notifier.num_fds <= fd)
490         gdb_notifier.num_fds = fd + 1;
491 +#endif
492      }
495 @@ -594,6 +653,23 @@ delete_file_handler (int fd)
496      }
497    else
498      {
499 +#ifdef __MINGW32__
500 +      /* Just realloc space. */
501 +      --gdb_notifier.num_fds;
503 +      xfree (gdb_notifier.waitable_handles);
504 +      xfree (gdb_notifier.waitable_files);
506 +      if (gdb_notifier.num_fds > 0)
507 +      {
508 +       gdb_notifier.waitable_handles = 
509 +         (HANDLE *)xmalloc( gdb_notifier.num_fds * sizeof( HANDLE));
510 +       gdb_notifier.waitable_files = 
511 +         (file_handler **)xmalloc( 
512 +           gdb_notifier.num_fds * sizeof( file_handler *)
513 +         );
514 +      }
515 +#else
516        if (file_ptr->mask & GDB_READABLE)
517         FD_CLR (fd, &gdb_notifier.check_masks[0]);
518        if (file_ptr->mask & GDB_WRITABLE)
519 @@ -615,6 +691,7 @@ delete_file_handler (int fd)
520             }
521           gdb_notifier.num_fds = i;
522         }
523 +#endif
524      }
526    /* Deactivate the file descriptor, by clearing its mask, 
527 @@ -696,6 +773,10 @@ handle_file_event (int event_file_desc)
528             }
529           else
530             {
531 +#ifdef __MINGW32__
532 +              /* Masks match when it's ready - simple! */
533 +             mask = file_ptr->ready_mask;
534 +#else
535               if (file_ptr->ready_mask & GDB_EXCEPTION)
536                 {
537                   printf_unfiltered ("Exception condition detected on fd %d\n", file_ptr->fd);
538 @@ -704,6 +785,7 @@ handle_file_event (int event_file_desc)
539               else
540                 file_ptr->error = 0;
541               mask = file_ptr->ready_mask & file_ptr->mask;
542 +#endif
543             }
545           /* Clear the received events for next time around. */
546 @@ -758,6 +840,59 @@ gdb_wait_for_event (void)
547      }
548    else
549      {
550 +#ifdef __MINGW32__
551 +       /* Since our users may close/dup fds without telling us, 
552 +          the safest (and simplest) thing is to do fd->HANDLE conversion 
553 +          every time just before calling WaitForMultipleObjects */
554 +          
555 +       /* NOTE: file_handler->mask is really abused here */
556 +       
557 +       int waitable_count = 0;
558 +       HANDLE h;
559 +       
560 +       for (file_ptr = gdb_notifier.first_file_handler;
561 +            file_ptr != NULL;
562 +            file_ptr = file_ptr->next_file)
563 +         {
564 +           file_ptr->mask = 1;
565 +         file_ptr->error = 0;
566 +           h = (HANDLE)_get_osfhandle (file_ptr->fd);
567 +           if (GetFileType (h) == FILE_TYPE_CHAR) /* console */
568 +             {
569 +             gdb_notifier.waitable_handles[waitable_count] = h;
570 +             gdb_notifier.waitable_files[waitable_count] = file_ptr;
571 +             ++waitable_count;
572 +             }
573 +           else /* consider it ready */
574 +             file_ptr->mask = 1;
575 +         }
576 +       if (waitable_count > 0)
577 +         {
578 +         DWORD r = WaitForMultipleObjects (waitable_count, 
579 +                     gdb_notifier.waitable_handles,
580 +                     false,
581 +                     gdb_notifier.timeout_valid 
582 +                      ?       gdb_notifier.select_timeout.tv_sec * 1000
583 +                            + gdb_notifier.select_timeout.tv_usec / 1000
584 +                      :  INFINITE);
585 +                      
586 +         if (r == WAIT_FAILED)
587 +         {
588 +           int i;
589 +           
590 +             printf_unfiltered( "gdb_wait_for_event: WaitForMultipleObjects failed: %x\n",
591 +                                   (unsigned)GetLastError() );
592 +           for (i=0; i<waitable_count; ++i )
593 +             gdb_notifier.waitable_files[i]->error = 1;
594 +         }
595 +                                 
596 +         /* WaitForMultipleObjects returns only the first ready object.
597 +            I don't know how to get to the others */
598 +         if (r >= WAIT_OBJECT_0 && r < WAIT_OBJECT_0 + waitable_count)
599 +           gdb_notifier.waitable_files[r-WAIT_OBJECT_0]->mask = 1;
600 +          
601 +      }
602 +#else
603        gdb_notifier.ready_masks[0] = gdb_notifier.check_masks[0];
604        gdb_notifier.ready_masks[1] = gdb_notifier.check_masks[1];
605        gdb_notifier.ready_masks[2] = gdb_notifier.check_masks[2];
606 @@ -778,6 +913,7 @@ gdb_wait_for_event (void)
607           if (errno != EINTR)
608             perror_with_name ("Select");
609         }
610 +#endif
611      }
613    /* Enqueue all detected file events. */
614 @@ -820,7 +956,25 @@ gdb_wait_for_event (void)
615      }
616    else
617      {
618 +#ifdef __MINGW32__
620 +      /* NOTE: file_handler->mask is really abused here */
621 +      
622        for (file_ptr = gdb_notifier.first_file_handler;
623 +           file_ptr != NULL;
624 +           file_ptr = file_ptr->next_file)
625 +        if (file_ptr->mask)
626 +          {
627 +            file_ptr->mask = 0;
628 +           if (file_ptr->ready_mask == 0)
629 +             {
630 +               file_event_ptr = create_file_event (file_ptr->fd);
631 +               async_queue_event (file_event_ptr, TAIL);
632 +               file_ptr->ready_mask = 1;
633 +             }
634 +          }
635 +#else
636 +      for (file_ptr = gdb_notifier.first_file_handler;
637            (file_ptr != NULL) && (num_found > 0);
638            file_ptr = file_ptr->next_file)
639         {
640 @@ -848,6 +1002,7 @@ gdb_wait_for_event (void)
641             }
642           file_ptr->ready_mask = mask;
643         }
644 +#endif
645      }
646    return 0;
648 Index: gdb/event-top.c
649 ===================================================================
650 RCS file: /prjz/.cvsroot/gdb/gdb/event-top.c,v
651 retrieving revision 1.1.1.1
652 diff -u -3 -p -r1.1.1.1 event-top.c
653 --- gdb/event-top.c     2003/02/16 21:34:07     1.1.1.1
654 +++ gdb/event-top.c     2003/02/16 22:03:17
655 @@ -27,6 +27,10 @@
656  #include "event-loop.h"
657  #include "event-top.h"
658  #include <signal.h>
659 +#ifdef __MINGW32__
660 +  /* MinGW does not yet (mingw-runtime-2.2) define SIGQUIT */
661 +  #define SIGQUIT 3
662 +#endif
664  /* For dont_repeat() */
665  #include "gdbcmd.h"
666 @@ -564,7 +568,9 @@ command_line_handler_continuation (struc
667    extern int display_space;
669    long time_at_cmd_start  = arg->data.longint;
670 +#ifdef HAVE_SBRK
671    long space_at_cmd_start = arg->next->data.longint;
672 +#endif
674    bpstat_do_actions (&stop_bpstat);
675    /*do_cleanups (old_chain); *//*?????FIXME????? */
676 @@ -967,9 +973,13 @@ handle_sigint (int sig)
677       processed only the next time through the event loop.  To get to
678       that point, though, the command that we want to interrupt needs to
679       finish first, which is unacceptable. */
680 +#ifndef __MINGW32__
681 +  /* MS docs say that you shouldn't call library routines from Ctrl+C 
682 +     handler */
683    if (immediate_quit)
684      async_request_quit (0);
685    else
686 +#endif
687      /* If immediate quit is not set, we process SIGINT the next time
688         through the loop, which is fine. */
689      mark_async_signal_handler_wrapper (sigint_token);
690 Index: gdb/infcmd.c
691 ===================================================================
692 RCS file: /prjz/.cvsroot/gdb/gdb/infcmd.c,v
693 retrieving revision 1.1.1.1
694 diff -u -3 -p -r1.1.1.1 infcmd.c
695 --- gdb/infcmd.c        2003/02/16 21:34:16     1.1.1.1
696 +++ gdb/infcmd.c        2003/02/16 22:03:17
697 @@ -196,7 +196,7 @@ int step_multi;
698  /* Environment to use for running inferior,
699     in format described in environ.h.  */
701 -struct environ *inferior_environ;
702 +struct gdb_environ *inferior_environ;
703  \f
704  /* Accessor routines. */
706 Index: gdb/inferior.h
707 ===================================================================
708 RCS file: /prjz/.cvsroot/gdb/gdb/inferior.h,v
709 retrieving revision 1.1.1.1
710 diff -u -3 -p -r1.1.1.1 inferior.h
711 --- gdb/inferior.h      2003/02/16 21:34:16     1.1.1.1
712 +++ gdb/inferior.h      2003/02/16 22:03:18
713 @@ -134,7 +134,7 @@ extern int inferior_ignoring_leading_exe
715  /* Inferior environment. */
717 -extern struct environ *inferior_environ;
718 +extern struct gdb_environ *inferior_environ;
720  extern void clear_proceed_status (void);
722 Index: gdb/remote.c
723 ===================================================================
724 RCS file: /prjz/.cvsroot/gdb/gdb/remote.c,v
725 retrieving revision 1.1.1.1
726 diff -u -3 -p -r1.1.1.1 remote.c
727 --- gdb/remote.c        2003/02/16 21:34:29     1.1.1.1
728 +++ gdb/remote.c        2003/02/16 22:03:18
729 @@ -5666,6 +5666,11 @@ readtty (void)
730  static int
731  minitelnet (void)
733 +#ifdef __MINGW32__
734 +  /* Under MinGW, this code is unusable until something more sensible than
735 +     ser-dummy is implemented. */
736 +  return FATAL_ERROR; 
737 +#else
738    fd_set input;                        /* file descriptors for select */
739    int tablesize;               /* max number of FDs for select */
740    int status;
741 @@ -5744,6 +5749,7 @@ minitelnet (void)
742           return status;        /* telnet session ended */
743         }
744      }
745 +#endif
748  static ptid_t
749 Index: gdb/source.c
750 ===================================================================
751 RCS file: /prjz/.cvsroot/gdb/gdb/source.c,v
752 retrieving revision 1.1.1.1
753 diff -u -3 -p -r1.1.1.1 source.c
754 --- gdb/source.c        2003/02/16 21:34:33     1.1.1.1
755 +++ gdb/source.c        2003/02/16 22:03:18
756 @@ -124,6 +124,20 @@ static struct symtab *last_source_visite
757  static int last_source_error = 0;
758  \f
760 +int os_open (const char *name, int mode, int prot)
762 +#ifdef __MINGW32__
763 +  /* Someone has the habit of writing absolute paths starting with two
764 +     slashes to the EXE debug info. Windows treats this as a UNC (network
765 +     machine) name, causing a LONG delay when it tries unsuccessfully to
766 +     open it. Eliminate that. */
767 +  if (name[0] == '/' && name[1] == '/')
768 +    name++;
769 +#endif
771 +  return open (name, mode, prot);
774  /* Set the source file default for the "list" command to be S.
776     If S is NULL, and we don't have a default, find one.  This
777 @@ -548,7 +562,7 @@ openp (const char *path, int try_cwd_fir
778        int i;
779        filename = alloca (strlen (string) + 1);
780        strcpy (filename, string);
781 -      fd = open (filename, mode, prot);
782 +      fd = os_open (filename, mode, prot);
783        if (fd >= 0)
784         goto done;
785        for (i = 0; string[i]; i++)
786 @@ -601,7 +615,7 @@ openp (const char *path, int try_cwd_fir
787        strcat (filename + len, SLASH_STRING);
788        strcat (filename, string);
790 -      fd = open (filename, mode);
791 +      fd = os_open (filename, mode, prot);
792        if (fd >= 0)
793         break;
794      }
795 @@ -673,7 +687,7 @@ open_source_file (struct symtab *s)
796    /* Quick way out if we already know its full name */
797    if (s->fullname)
798      {
799 -      result = open (s->fullname, OPEN_MODE);
800 +      result = os_open (s->fullname, OPEN_MODE, S_IRWXU);
801        if (result >= 0)
802         return result;
803        /* Didn't work -- free old one, try again. */
804 Index: gdb/top.c
805 ===================================================================
806 RCS file: /prjz/.cvsroot/gdb/gdb/top.c,v
807 retrieving revision 1.1.1.1
808 diff -u -3 -p -r1.1.1.1 top.c
809 --- gdb/top.c   2003/02/16 21:34:35     1.1.1.1
810 +++ gdb/top.c   2003/02/16 22:03:19
811 @@ -30,6 +30,10 @@
812  #include "symtab.h"
813  #include "inferior.h"
814  #include <signal.h>
815 +#ifdef __MINGW32__
816 +  /* MinGW does not yet (mingw-runtime-2.2) define SIGQUIT */
817 +  #define SIGQUIT 3
818 +#endif
819  #include "target.h"
820  #include "breakpoint.h"
821  #include "gdbtypes.h"
822 Index: gdb/utils.c
823 ===================================================================
824 RCS file: /prjz/.cvsroot/gdb/gdb/utils.c,v
825 retrieving revision 1.1.1.1
826 diff -u -3 -p -r1.1.1.1 utils.c
827 --- gdb/utils.c 2003/02/16 21:34:36     1.1.1.1
828 +++ gdb/utils.c 2003/02/16 22:03:18
829 @@ -733,7 +733,10 @@ Create a core file containing the curren
830      {
831        if (dump_core_p)
832         {
833 +          /* TODO: MinGW has no fork - figure out how to continue anyway. */
834 +#ifndef CANT_FORK
835           if (fork () == 0)
836 +#endif
837             abort (); /* NOTE: GDB has only three calls to abort().  */
838         }
839      }
840 Index: gdb/win32-nat.c
841 ===================================================================
842 RCS file: /prjz/.cvsroot/gdb/gdb/win32-nat.c,v
843 retrieving revision 1.1.1.1
844 diff -u -3 -p -r1.1.1.1 win32-nat.c
845 --- gdb/win32-nat.c     2003/02/16 21:34:37     1.1.1.1
846 +++ gdb/win32-nat.c     2003/02/16 22:03:19
847 @@ -24,8 +24,6 @@
849  /* Originally by Steve Chamberlain, sac@cygnus.com */
851 -/* We assume we're being built with and will be used for cygwin.  */
853  #include "defs.h"
854  #include "tm.h"                        /* required for SSE registers */
855  #include "frame.h"             /* required by inferior.h */
856 @@ -43,7 +41,9 @@
857  #include <stdlib.h>
858  #include <windows.h>
859  #include <imagehlp.h>
860 -#include <sys/cygwin.h>
861 +#ifdef __CYGWIN__
862 +  #include <sys/cygwin.h>
863 +#endif
865  #include "buildsym.h"
866  #include "symfile.h"
867 @@ -52,6 +52,9 @@
868  #include "gdbthread.h"
869  #include "gdbcmd.h"
870  #include <sys/param.h>
871 +#ifdef __MINGW32__
872 +  #define MAXPATHLEN PATH_MAX
873 +#endif
874  #include <unistd.h>
876  /* The ui's event loop. */
877 @@ -66,8 +69,66 @@ enum
878      FLAG_TRACE_BIT = 0x100,
879      CONTEXT_DEBUGGER = (CONTEXT_FULL | CONTEXT_FLOATING_POINT)
880    };
881 +#endif
882 +#ifndef __MINGW32__
883 +  #include <sys/procfs.h>
884 +#else
885 +  #define      NOTE_INFO_PROCESS       1
886 +  #define      NOTE_INFO_THREAD        2
887 +  #define      NOTE_INFO_MODULE        3
889 +  struct win32_core_process_info
890 +  {
891 +    DWORD pid;
892 +    int signal;
893 +    int command_line_size;
894 +    char command_line[1];
895 +  }
896 +  #ifdef __GNUC__
897 +    __attribute__ ((packed))
898 +  #endif
899 +  ;
901 +  struct win32_core_thread_info
902 +  {
903 +    DWORD tid;
904 +    BOOL is_active_thread;
905 +    CONTEXT thread_context;
906 +  }
907 +  #ifdef __GNUC__
908 +    __attribute__ ((packed))
909 +  #endif
910 +  ;
912 +  struct win32_core_module_info
913 +  {
914 +    void* base_address;
915 +    int module_name_size;
916 +    char module_name[1];
917 +  }
918 +  #ifdef __GNUC__
919 +    __attribute__ ((packed))
920 +  #endif
921 +  ;
923 +  struct win32_pstatus
924 +  {
925 +    unsigned long data_type;
926 +    union
927 +      {
928 +        struct win32_core_process_info process_info;
929 +        struct win32_core_thread_info thread_info;
930 +        struct win32_core_module_info module_info;
931 +      } data ;
932 +  }
933 +  #ifdef __GNUC__
934 +    __attribute__ ((packed))
935 +  #endif
936 +  ;
938 +  typedef struct win32_pstatus win32_pstatus_t ;
940  #endif
941 -#include <sys/procfs.h>
942  #include <psapi.h>
944  #ifdef HAVE_SSE_REGS
945 @@ -132,7 +193,7 @@ static int event_count = 0;
946  static int saw_create;
948  /* User options. */
949 -static int new_console = 0;
950 +static int new_console = 1;
951  static int new_group = 1;
952  static int debug_exec = 0;             /* show execution */
953  static int debug_events = 0;           /* show events from kernel */
954 @@ -597,7 +658,12 @@ register_loaded_dll (const char *name, D
955         }
956      }
958 +#ifdef __CYGWIN__
959    cygwin_conv_to_posix_path (buf, ppath);
960 +#else
961 +  strcpy( ppath, buf);
962 +#endif
964    so = (struct so_stuff *) xmalloc (sizeof (struct so_stuff) + strlen (ppath) + 8 + 1);
965    so->loaded = 0;
966    so->load_addr = load_addr;
967 @@ -1462,6 +1528,12 @@ child_create_inferior (char *exec_file, 
968    char shell[MAX_PATH + 1]; /* Path to shell */
969    const char *sh;
971 +  /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */
972 +  HANDLE hStdInput = 0;
973 +  HANDLE hStdOutput = 0;
974 +  HANDLE hStdError = 0;
975 +  /* END: Fragment of Al Stevens's patch for GDB on Win9x */
977    if (!exec_file)
978      error ("No executable specified, use `target exec'.\n");
980 @@ -1471,7 +1543,11 @@ child_create_inferior (char *exec_file, 
981    if (!useshell)
982      {
983        flags = DEBUG_ONLY_THIS_PROCESS;
984 +#ifdef __CYGWIN__
985        cygwin_conv_to_win32_path (exec_file, real_path);
986 +#else
987 +      strcpy( real_path, exec_file);
988 +#endif
989        toexec = real_path;
990      }
991    else
992 @@ -1480,7 +1556,11 @@ child_create_inferior (char *exec_file, 
993        sh = getenv ("SHELL");
994        if (!sh)
995         sh = "/bin/sh";
996 +#ifdef __CYGWIN__
997        cygwin_conv_to_win32_path (sh, shell);
998 +#else
999 +      strcpy( shell, sh);
1000 +#endif
1001        newallargs = alloca (sizeof (" -c 'exec  '") + strlen (exec_file)
1002                            + strlen (allargs) + 2);
1003        sprintf (newallargs, " -c 'exec %s %s'", exec_file, allargs);
1004 @@ -1529,10 +1609,12 @@ child_create_inferior (char *exec_file, 
1005             len = strlen (conv_path_names[j]);
1006             if (strncmp (conv_path_names[j], env[i], len) == 0)
1007               {
1008 +#ifdef __CYGWIN__
1009                 if (cygwin_posix_path_list_p (env[i] + len))
1010                   envlen += len
1011                     + cygwin_posix_to_win32_path_list_buf_size (env[i] + len);
1012                 else
1013 +#endif
1014                   envlen += strlen (env[i]) + 1;
1015                 break;
1016               }
1017 @@ -1553,12 +1635,14 @@ child_create_inferior (char *exec_file, 
1018             len = strlen (conv_path_names[j]);
1019             if (strncmp (conv_path_names[j], env[i], len) == 0)
1020               {
1021 +#ifdef __CYGWIN__
1022                 if (cygwin_posix_path_list_p (env[i] + len))
1023                   {
1024                     memcpy (temp, env[i], len);
1025                     cygwin_posix_to_win32_path_list (env[i] + len, temp + len);
1026                   }
1027                 else
1028 +#endif
1029                   strcpy (temp, env[i]);
1030                 break;
1031               }
1032 @@ -1573,6 +1657,19 @@ child_create_inferior (char *exec_file, 
1033      *temp = 0;
1034    }
1036 +  /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */
1037 +  if ( new_console)
1038 +    {
1039 +      hStdInput = GetStdHandle( STD_INPUT_HANDLE);
1040 +      hStdOutput = GetStdHandle( STD_OUTPUT_HANDLE);
1041 +      hStdError = GetStdHandle( STD_ERROR_HANDLE);
1043 +      SetStdHandle( STD_INPUT_HANDLE, INVALID_HANDLE_VALUE);
1044 +      SetStdHandle( STD_OUTPUT_HANDLE, INVALID_HANDLE_VALUE);
1045 +      SetStdHandle( STD_ERROR_HANDLE, INVALID_HANDLE_VALUE);
1046 +    }
1047 +  /* END: Fragment of Al Stevens's patch for GDB on Win9x */
1049    ret = CreateProcess (0,
1050                        args,    /* command line */
1051                        NULL,    /* Security */
1052 @@ -1588,6 +1685,15 @@ child_create_inferior (char *exec_file, 
1054    CloseHandle (pi.hThread);
1055    CloseHandle (pi.hProcess);
1057 +  /* BEGIN: Fragment of Al Stevens's patch for GDB on Win9x */
1058 +  if ( new_console)
1059 +    {
1060 +      SetStdHandle( STD_INPUT_HANDLE, hStdInput);
1061 +      SetStdHandle( STD_OUTPUT_HANDLE, hStdOutput);
1062 +      SetStdHandle( STD_ERROR_HANDLE, hStdError);
1063 +    }
1064 +  /* END: Fragment of Al Stevens's patch for GDB on Win9x */
1066    if (useshell && shell[0] != '\0')
1067      saw_create = -1;
1068 Index: gdb/mi/mi-main.c
1069 ===================================================================
1070 RCS file: /prjz/.cvsroot/gdb/gdb/mi/mi-main.c,v
1071 retrieving revision 1.1.1.1
1072 diff -u -3 -p -r1.1.1.1 mi-main.c
1073 --- gdb/mi/mi-main.c    2003/02/16 21:35:17     1.1.1.1
1074 +++ gdb/mi/mi-main.c    2003/02/16 22:03:17
1075 @@ -42,6 +42,10 @@
1076  #include <ctype.h>
1077  #include <sys/time.h>
1079 +#ifdef __MINGW32__
1080 +  #include <mingw-gettimeofday.h>
1081 +#endif
1083  /* Convenience macro for allocting typesafe memory. */
1085  #undef XMALLOC
1086 Index: readline/CHANGELOG
1087 ===================================================================
1088 RCS file: /prjz/.cvsroot/gdb/readline/CHANGELOG,v
1089 retrieving revision 1.1.1.1
1090 diff -u -3 -p -r1.1.1.1 CHANGELOG
1091 --- readline/CHANGELOG  2003/02/16 21:36:29     1.1.1.1
1092 +++ readline/CHANGELOG  2001/04/06 19:15:12
1093 @@ -337,3 +337,129 @@ doc/Makefile.in
1095  configure.in
1096         - changed LIBVERSION to 4.1-beta5
1098 +                                3/17/2000
1099 +                                ---------
1100 +[readline-4.1 released]
1102 +                                  3/23
1103 +                                  ----
1104 +Makefile.in
1105 +       - remove the `-t' argument to ranlib in the install recipe; some
1106 +         ranlibs don't have it and attempt to create a file named `-t'
1108 +                                  3/27
1109 +                                  ----
1110 +support/shlib-install
1111 +       - install shared libraries unwritable by anyone on HP-UX
1112 +       - changed symlinks to relative pathnames on all platforms
1114 +shlib/Makefile.in
1115 +       - added missing `includedir' assignment, substituted by configure
1117 +Makefile.in
1118 +       - added missing @SET_MAKE@ so configure can set $MAKE appropriately
1120 +configure.in
1121 +       - add call to AC_PROG_MAKE_SET
1123 +                                  8/30
1124 +                                  ----
1125 +shlib/Makefile.in
1126 +       - change the soname bound into the shared libraries, so it includes
1127 +         only the major version number.  If it includes the minor version,
1128 +         programs depending on it must be rebuilt (which may or may not be
1129 +         a bad thing)
1131 +                                   9/6
1132 +                                   ---
1133 +examples/rlfe.c
1134 +       - add -l option to log input and output (-a option appends to logfile)
1135 +       - add -n option to set readline application name
1136 +       - add -v, -h options for version and help information
1137 +       - change a few things because getopt() is now used to parse arguments
1139 +                                  9/12
1140 +                                  ----
1141 +support/shlib-install
1142 +       - fix up the libname on HPUX 11
1144 +                                  10/18
1145 +                                  -----
1146 +configure.in
1147 +       - changed library version to 4.2-alpha
1149 +                                  10/30
1150 +                                  -----
1151 +configure.in
1152 +       - add -fsigned-char to LOCAL_CFLAGS for Linux running on the IBM
1153 +         S/390
1155 +Makefile.in
1156 +       - added new file, rltypedefs.h, installed by default with `make install'
1158 +                                  11/2
1159 +                                  ----
1160 +compat.c
1161 +       - new file, with backwards-compatibility function definitions
1163 +Makefile.in,shlib/Makefile.in
1164 +       - make sure that compat.o/compat.so are built and linked apppropriately
1166 +support/shobj-conf
1167 +       - picked up bash version, which means that shared libs built on
1168 +         linux and BSD/OS 4.x will have an soname that does not include
1169 +         the minor version number
1171 +                                  11/13
1172 +                                  -----
1173 +examples/rlfe.c
1174 +       - rlfe can perform filename completion for relative pathnames in the
1175 +         inferior process's context if the OS supports /proc/PID/cwd (linux
1176 +         does it OK, Solaris is slightly warped, none of the BSDs have it)
1178 +                               11/17/2000
1179 +                               ----------
1180 +[readline-4.2-alpha released]
1182 +                                  11/27
1183 +                                  -----
1184 +Makefile.in,shlib/Makefile.in
1185 +       - added dependencies for rltypedefs.h
1187 +shlib/Makefile.in
1188 +       - changed dependencies on histlib.h to $(topdir)/histlib.h
1190 +                                  1/22
1191 +                                  ----
1192 +configure.in
1193 +       - changed release version to 4.2-beta
1195 +                                   2/2
1196 +                                   ---
1197 +examples/Makefile.in
1198 +       - build histexamp as part of the examples
1200 +                                   2/5
1201 +                                   ---
1202 +doc/Makefile.in
1203 +       - don't remove the dvi, postscript, html, info, and text `objects'
1204 +         on a `make distclean', only on a `make maintainer-clean'
1206 +                                   3/6
1207 +                                   ---
1208 +doc/history.{0,3}, doc/history_3.ps
1209 +       - new manual page for history library
1211 +doc/Makefile.in
1212 +       - rules to install and uninstall history.3 in ${man3dir}
1213 +       - rules to build history.0 and history_3.ps
1215 +                                   4/2
1216 +                                   ---
1217 +configure.in
1218 +       - changed LIBVERSION to `4.2'
1220 +                                   4/5
1221 +                                   ---
1222 +[readline-4.2 frozen]
1223 Index: readline/CHANGES
1224 ===================================================================
1225 RCS file: /prjz/.cvsroot/gdb/readline/CHANGES,v
1226 retrieving revision 1.1.1.1
1227 diff -u -3 -p -r1.1.1.1 CHANGES
1228 --- readline/CHANGES    2003/02/16 21:36:29     1.1.1.1
1229 +++ readline/CHANGES    2001/04/03 14:34:07
1230 @@ -1,3 +1,156 @@
1231 +This document details the changes between this version, readline-4.2,
1232 +and the previous version, readline-4.1.
1234 +1.  Changes to Readline
1236 +a.  When setting the terminal attributes on systems using `struct termio',
1237 +    readline waits for output to drain before changing the attributes.
1239 +b.  A fix was made to the history word tokenization code to avoid attempts to
1240 +    dereference a null pointer.
1242 +c.  Readline now defaults rl_terminal_name to $TERM if the calling application
1243 +    has left it unset, and tries to initialize with the resultant value.
1245 +d.  Instead of calling (*rl_getc_function)() directly to get input in certain
1246 +    places, readline now calls rl_read_key() consistently.
1248 +e.  Fixed a bug in the completion code that allowed a backslash to quote a
1249 +    single quote inside a single-quoted string.
1251 +f.  rl_prompt is no longer assigned directly from the argument to readline(),
1252 +    but uses memory allocated by readline.  This allows constant strings to
1253 +    be passed to readline without problems arising when the prompt processing
1254 +    code wants to modify the string.
1256 +g.  Fixed a bug that caused non-interactive history searches to return the
1257 +    wrong line when performing multiple searches backward for the same string.
1259 +h.  Many variables, function arguments, and function return values are now
1260 +    declared `const' where appropriate, to improve behavior when linking with
1261 +    C++ code.
1263 +i.  The control character detection code now works better on systems where
1264 +    `char' is unsigned by default.
1266 +j.  The vi-mode numeric argument is now capped at 999999, just like emacs mode.
1268 +k.  The Function, CPFunction, CPPFunction, and VFunction typedefs have been
1269 +    replaced with a set of specific prototyped typedefs, though they are
1270 +    still in the readline header files for backwards compatibility.
1272 +m.  Nearly all of the (undocumented) internal global variables in the library
1273 +    now have an _rl_ prefix -- there were a number that did not, like
1274 +    screenheight, screenwidth, alphabetic, etc.
1276 +n.  The ding() convenience function has been renamed to rl_ding(), though the
1277 +    old function is still defined for backwards compatibility.
1279 +o.  The completion convenience functions filename_completion_function,
1280 +    username_completion_function, and completion_matches now have an rl_
1281 +    prefix, though the old names are still defined for backwards compatibility.
1283 +p.  The functions shared by readline and bash (linkage is satisfied from bash
1284 +    when compiling with bash, and internally otherwise) now have an sh_ prefix.
1286 +q.  Changed the shared library creation procedure on Linux and BSD/OS 4.x so
1287 +    that the `soname' contains only the major version number rather than the
1288 +    major and minor numbers.
1290 +r.  Fixed a redisplay bug that occurred when the prompt spanned more than one
1291 +    physical line and contained invisible characters.
1293 +s.  Added a missing `includedir' variable to the Makefile.
1295 +t.  When installing the shared libraries, make sure symbolic links are relative.
1297 +u.  Added configure test so that it can set `${MAKE}' appropriately.
1299 +v.  Fixed a bug in rl_forward that could cause the point to be set to before
1300 +    the beginning of the line in vi mode.
1302 +w.  Fixed a bug in the callback read-char interface to make it work when a
1303 +    readline function pushes some input onto the input stream with
1304 +    rl_execute_next (like the incremental search functions).
1306 +x.  Fixed a file descriptor leak in the history file manipulation code that
1307 +    was tripped when attempting to truncate a non-regular file (like
1308 +    /dev/null).
1310 +y.  Changes to make all of the exported readline functions declared in
1311 +    readline.h have an rl_ prefix (rltty_set_default_bindings is now
1312 +    rl_tty_set_default_bindings, crlf is now rl_crlf, etc.)
1314 +z.  The formatted documentation included in the base readline distribution
1315 +    is no longer removed on a `make distclean'.
1317 +aa. Some changes were made to avoid gcc warnings with -Wall.
1319 +bb. rl_get_keymap_by_name now finds keymaps case-insensitively, so
1320 +    `set keymap EMACS' works.
1322 +cc. The history file writing and truncation functions now return a useful
1323 +    status on error.
1325 +dd. Fixed a bug that could cause applications to dereference a NULL pointer
1326 +    if a NULL second argument was passed to history_expand().
1328 +ee. If a hook function assigned to rl_event_hook sets rl_done to a non-zero
1329 +    value, rl_read_key() now immediately returns '\n' (which is assumed to   
1330 +    be bound to accept-line).
1332 +2.  New Features in Readline
1334 +a.  The blink timeout for paren matching is now settable by applications,
1335 +    via the rl_set_paren_blink_timeout() function.
1337 +b.  _rl_executing_macro has been renamed to rl_executing_macro, which means
1338 +    it's now part of the public interface.
1340 +c.  Readline has a new variable, rl_readline_state, which is a bitmap that
1341 +    encapsulates the current state of the library; intended for use by
1342 +    callbacks and hook functions.
1344 +d.  rlfe has a new -l option to log input and output (-a appends to logfile),
1345 +    a new -n option to set the readline application name, and -v and -h
1346 +    options for version and help information.
1348 +e.  rlfe can now perform filename completion for the inferior process if the
1349 +    OS has a /proc/<PID>/cwd that can be read with readlink(2) to get the
1350 +    inferior's current working directory.
1352 +f.  A new file, rltypedefs.h, contains the new typedefs for function pointers
1353 +    and is installed by `make install'.
1355 +g.  New application-callable function rl_set_prompt(const char *prompt):
1356 +    expands its prompt string argument and sets rl_prompt to the result.
1358 +h.  New application-callable function rl_set_screen_size(int rows, int cols):
1359 +    public method for applications to set readline's idea of the screen
1360 +    dimensions.
1362 +i.  The history example program (examples/histexamp.c) is now built as one
1363 +    of the examples.
1365 +j.  The documentation has been updated to cover nearly all of the public
1366 +    functions and variables declared in readline.h.
1368 +k.  New function, rl_get_screen_size (int *rows, int *columns), returns
1369 +    readline's idea of the screen dimensions.
1371 +l.  The timeout in rl_gather_tyi (readline keyboard input polling function)
1372 +    is now settable via a function (rl_set_keyboard_input_timeout()).
1374 +m.  Renamed the max_input_history variable to history_max_entries; the old
1375 +    variable is maintained for backwards compatibility.
1377 +n.  The list of characters that separate words for the history tokenizer is
1378 +    now settable with a variable:  history_word_delimiters.  The default
1379 +    value is as before.
1381 +o.  There is a new history.3 manual page documenting the history library.
1383 +-------------------------------------------------------------------------------
1384  This document details the changes between this version, readline-4.1,
1385  and the previous version, readline-4.0.
1387 Index: readline/MANIFEST
1388 ===================================================================
1389 RCS file: /prjz/.cvsroot/gdb/readline/MANIFEST,v
1390 retrieving revision 1.1.1.1
1391 diff -u -3 -p -r1.1.1.1 MANIFEST
1392 --- readline/MANIFEST   2003/02/16 21:36:31     1.1.1.1
1393 +++ readline/MANIFEST   2001/03/05 19:34:36
1394 @@ -32,11 +32,13 @@ rlprivate.h f
1395  rlshell.h      f
1396  rlstdc.h       f
1397  rltty.h                f
1398 +rltypedefs.h   f
1399  rlwinsize.h    f
1400  tcap.h         f
1401  tilde.h                f
1402  xmalloc.h      f
1403  bind.c         f
1404 +compat.c       f
1405  complete.c     f
1406  display.c      f
1407  emacs_keymap.c f
1408 @@ -85,6 +87,7 @@ doc/hist.texinfo      f
1409  doc/hstech.texinfo     f
1410  doc/hsuser.texinfo     f
1411  doc/readline.3         f
1412 +doc/history.3          f
1413  doc/texi2dvi           f
1414  doc/texi2html          f
1415  examples/Makefile.in   f
1416 @@ -111,3 +114,6 @@ doc/readline.html   f
1417  doc/history.html       f
1418  doc/rluserman.html     f
1419  doc/readline.0         f
1420 +doc/history.0          f
1421 +doc/readline_3.ps      f
1422 +doc/history_3.ps       f
1423 Index: readline/Makefile.in
1424 ===================================================================
1425 RCS file: /prjz/.cvsroot/gdb/readline/Makefile.in,v
1426 retrieving revision 1.1.1.1
1427 diff -u -3 -p -r1.1.1.1 Makefile.in
1428 --- readline/Makefile.in        2003/02/16 21:36:31     1.1.1.1
1429 +++ readline/Makefile.in        2000/11/27 16:57:09
1430 @@ -1,6 +1,6 @@
1431  ## -*- text -*- ##
1432  # Master Makefile for the GNU readline library.
1433 -# Copyright (C) 1994, 1998 Free Software Foundation, Inc.
1434 +# Copyright (C) 1994 Free Software Foundation, Inc.
1436  # This program is free software; you can redistribute it and/or modify
1437  # it under the terms of the GNU General Public License as published by
1438 @@ -19,7 +19,7 @@ RL_LIBRARY_VERSION = @LIBVERSION@
1439  RL_LIBRARY_NAME = readline
1441  srcdir = @srcdir@
1442 -VPATH = @srcdir@
1443 +VPATH = .:@srcdir@
1444  top_srcdir = @top_srcdir@
1445  BUILD_DIR = @BUILD_DIR@
1447 @@ -35,6 +35,7 @@ RM = rm -f
1448  CP = cp
1449  MV = mv
1451 +@SET_MAKE@
1452  SHELL = @MAKE_SHELL@
1454  prefix = @prefix@
1455 @@ -65,8 +66,15 @@ TERMCAP_LIB = @TERMCAP_LIB@
1456  # For libraries which include headers from other libraries.
1457  INCLUDES = -I. -I$(srcdir) -I$(includedir)
1459 -CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES) $(LOCAL_CFLAGS) $(CFLAGS)
1460 +XCCFLAGS = $(DEFS) $(LOCAL_DEFS) $(CPPFLAGS) $(INCLUDES)
1461 +CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS)
1463 +# could add -Werror here
1464 +GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \
1465 +                -Wwrite-strings -Wstrict-prototypes \
1466 +                -Wmissing-prototypes -Wno-implicit
1467 +GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@
1469  .c.o:
1470         ${RM} $@
1471         $(CC) -c $(CCFLAGS) $<
1472 @@ -85,19 +93,21 @@ CSOURCES = $(srcdir)/readline.c $(srcdir
1473            $(srcdir)/callback.c $(srcdir)/terminal.c $(srcdir)/xmalloc.c \
1474            $(srcdir)/history.c $(srcdir)/histsearch.c $(srcdir)/histexpand.c \
1475            $(srcdir)/histfile.c $(srcdir)/nls.c $(srcdir)/search.c \
1476 -          $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c
1477 +          $(srcdir)/shell.c $(srcdir)/savestring.c $(srcdir)/tilde.c \
1478 +          $(srcdir)/compat.c
1480  # The header files for this library.
1481  HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
1482            posixstat.h posixdir.h posixjmp.h tilde.h rlconf.h rltty.h \
1483 -          ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h
1484 +          ansi_stdlib.h tcap.h rlstdc.h xmalloc.h rlprivate.h rlshell.h \
1485 +          rltypedefs.h
1487  HISTOBJ = history.o histexpand.o histfile.o histsearch.o shell.o 
1488  TILDEOBJ = tilde.o
1489  OBJECTS = readline.o vi_mode.o funmap.o keymaps.o parens.o search.o \
1490           rltty.o complete.o bind.o isearch.o display.o signals.o \
1491           util.o kill.o undo.o macro.o input.o callback.o terminal.o \
1492 -         nls.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
1493 +         nls.o compat.o xmalloc.o $(HISTOBJ) $(TILDEOBJ)
1495  # The texinfo files which document this library.
1496  DOCSOURCE = doc/rlman.texinfo doc/rltech.texinfo doc/rluser.texinfo
1497 @@ -111,7 +121,7 @@ CREATED_CONFIGURE = config.status config
1498  CREATED_TAGS = TAGS tags
1500  INSTALLED_HEADERS = readline.h chardefs.h keymaps.h history.h tilde.h \
1501 -                   rlstdc.h rlconf.h
1502 +                   rlstdc.h rlconf.h rltypedefs.h
1504  ##########################################################################
1506 @@ -134,6 +144,9 @@ libhistory.a: $(HISTOBJ) xmalloc.o
1507  readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a
1508         $(CC) $(CCFLAGS) -o $@ ./examples/rl.c ./libreadline.a ${TERMCAP_LIB}
1510 +lint:  force
1511 +       $(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static
1513  Makefile makefile: config.status $(srcdir)/Makefile.in
1514         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
1516 @@ -154,6 +167,7 @@ stamp-h: config.status $(srcdir)/config.
1517  #$(srcdir)/configure: $(srcdir)/configure.in   ## Comment-me-out in distribution
1518  #      cd $(srcdir) && autoconf        ## Comment-me-out in distribution
1521  shared:        force
1522         -test -d shlib || mkdir shlib
1523         -( cd shlib ; ${MAKE} ${MFLAGS} all )
1524 @@ -179,27 +193,17 @@ uninstall-headers:
1526  maybe-uninstall-headers: uninstall-headers
1528 -## CYGNUS LOCAL
1529 -## Don't mess with people's installed readline's.
1530 -## This tries to install this version of readline over whatever
1531 -## version is already installed on the system (which could be a
1532 -## newer version). There is no real reason for us to install
1533 -## readline along with GDB. GDB links statically against readline,
1534 -## so it doesn't depend on us installing it on the system.
1536 -install:
1538 -#install: installdirs $(STATIC_LIBS) install-headers
1539 -#      -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
1540 -#      $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
1541 -#      -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libreadline.a
1542 -#      -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
1543 -#      $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
1544 -#      -test -n "$(RANLIB)" && $(RANLIB) -t $(libdir)/libhistory.a
1545 -#      -( if test -d doc ; then \
1546 -#              cd doc && \
1547 -#              ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
1548 -#        fi )
1549 +install: installdirs $(STATIC_LIBS) install-headers
1550 +       -$(MV) $(libdir)/libreadline.a $(libdir)/libreadline.old
1551 +       $(INSTALL_DATA) libreadline.a $(libdir)/libreadline.a
1552 +       -test -n "$(RANLIB)" && $(RANLIB) $(libdir)/libreadline.a
1553 +       -$(MV) $(libdir)/libhistory.a $(libdir)/libhistory.old
1554 +       $(INSTALL_DATA) libhistory.a $(libdir)/libhistory.a
1555 +       -test -n "$(RANLIB)" && $(RANLIB) $(libdir)/libhistory.a
1556 +       -( if test -d doc ; then \
1557 +               cd doc && \
1558 +               ${MAKE} ${MFLAGS} infodir=$(infodir) $@; \
1559 +         fi )
1561  installdirs: $(srcdir)/support/mkdirs
1562         -$(SHELL) $(srcdir)/support/mkdirs $(includedir) \
1563 @@ -262,90 +266,91 @@ dist:   force
1564  # Dependencies
1565  bind.o: ansi_stdlib.h posixstat.h
1566  bind.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1567 -bind.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1568 +bind.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1569  bind.o: history.h
1570  callback.o: rlconf.h
1571  callback.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1572 -callback.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1573 +callback.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1574 +compat.o: rlstdc.h
1575  complete.o: ansi_stdlib.h posixdir.h posixstat.h
1576  complete.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1577 -complete.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1578 +complete.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1579  display.o: ansi_stdlib.h posixstat.h
1580  display.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1581  display.o: tcap.h
1582 -display.o: readline.h keymaps.h chardefs.h tilde.h
1583 +display.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1584  display.o: history.h rlstdc.h
1585 -funmap.o: readline.h keymaps.h chardefs.h tilde.h
1586 +funmap.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1587  funmap.o: rlconf.h ansi_stdlib.h rlstdc.h
1588  funmap.o: ${BUILD_DIR}/config.h
1589  histexpand.o: ansi_stdlib.h
1590 -histexpand.o: history.h histlib.h rlstdc.h
1591 +histexpand.o: history.h histlib.h rlstdc.h rltypedefs.h
1592  histexpand.o: ${BUILD_DIR}/config.h
1593  histfile.o: ansi_stdlib.h
1594 -histfile.o: history.h histlib.h rlstdc.h
1595 +histfile.o: history.h histlib.h rlstdc.h rltypedefs.h
1596  histfile.o: ${BUILD_DIR}/config.h
1597  history.o: ansi_stdlib.h
1598 -history.o: history.h histlib.h rlstdc.h
1599 +history.o: history.h histlib.h rlstdc.h rltypedefs.h
1600  history.o: ${BUILD_DIR}/config.h
1601  histsearch.o: ansi_stdlib.h
1602 -histsearch.o: history.h histlib.h rlstdc.h
1603 +histsearch.o: history.h histlib.h rlstdc.h rltypedefs.h
1604  histsearch.o: ${BUILD_DIR}/config.h
1605  input.o: ansi_stdlib.h
1606  input.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1607 -input.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1608 +input.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1609  isearch.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1610 -isearch.o: readline.h keymaps.h chardefs.h tilde.h
1611 +isearch.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1612  isearch.o: ansi_stdlib.h history.h rlstdc.h
1613  keymaps.o: emacs_keymap.c vi_keymap.c
1614 -keymaps.o: keymaps.h chardefs.h rlconf.h ansi_stdlib.h
1615 -keymaps.o: readline.h keymaps.h chardefs.h tilde.h
1616 +keymaps.o: keymaps.h rltypedefs.h chardefs.h rlconf.h ansi_stdlib.h
1617 +keymaps.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1618  keymaps.o: ${BUILD_DIR}/config.h rlstdc.h
1619  kill.o: ansi_stdlib.h
1620  kill.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1621 -kill.o: readline.h keymaps.h chardefs.h tilde.h
1622 +kill.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1623  kill.o: history.h rlstdc.h
1624  macro.o: ansi_stdlib.h
1625  macro.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1626 -macro.o: readline.h keymaps.h chardefs.h tilde.h
1627 +macro.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1628  macro.o: history.h rlstdc.h
1629  nls.o: ansi_stdlib.h
1630  nls.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1631 -nls.o: readline.h keymaps.h chardefs.h tilde.h  
1632 +nls.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h  
1633  nls.o: history.h rlstdc.h  
1634  parens.o: rlconf.h
1635  parens.o: ${BUILD_DIR}/config.h
1636 -parens.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1637 -readline.o: readline.h keymaps.h chardefs.h tilde.h
1638 +parens.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1639 +readline.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1640  readline.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1641  readline.o: history.h rlstdc.h
1642  readline.o: posixstat.h ansi_stdlib.h posixjmp.h
1643  rltty.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1644  rltty.o: rltty.h
1645 -rltty.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1646 +rltty.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1647  search.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1648 -search.o: readline.h keymaps.h chardefs.h tilde.h
1649 +search.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1650  search.o: ansi_stdlib.h history.h rlstdc.h
1651  shell.o: ${BUILD_DIR}/config.h
1652  shell.o: ansi_stdlib.h
1653  signals.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1654 -signals.o: readline.h keymaps.h chardefs.h tilde.h
1655 +signals.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1656  signals.o: history.h rlstdc.h
1657  terminal.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1658  terminal.o: tcap.h
1659 -terminal.o: readline.h keymaps.h chardefs.h tilde.h
1660 +terminal.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1661  terminal.o: history.h rlstdc.h
1662  tilde.o: ansi_stdlib.h
1663  tilde.o: ${BUILD_DIR}/config.h
1664  tilde.o: tilde.h
1665  undo.o: ansi_stdlib.h
1666  undo.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1667 -undo.o: readline.h keymaps.h chardefs.h tilde.h
1668 +undo.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1669  undo.o: history.h rlstdc.h
1670  util.o: posixjmp.h ansi_stdlib.h
1671  util.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1672 -util.o: readline.h keymaps.h chardefs.h tilde.h rlstdc.h
1673 +util.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h rlstdc.h
1674  vi_mode.o: rldefs.h ${BUILD_DIR}/config.h rlconf.h
1675 -vi_mode.o: readline.h keymaps.h chardefs.h tilde.h
1676 +vi_mode.o: readline.h keymaps.h rltypedefs.h chardefs.h tilde.h
1677  vi_mode.o: history.h ansi_stdlib.h rlstdc.h
1678  xmalloc.o: ${BUILD_DIR}/config.h
1679  xmalloc.o: ansi_stdlib.h
1680 @@ -405,6 +410,7 @@ keymaps.o: $(srcdir)/keymaps.c
1681  parens.o: $(srcdir)/parens.c
1682  search.o: $(srcdir)/search.c
1683  rltty.o: $(srcdir)/rltty.c
1684 +compat.o: $(srcdir)/compat.c
1685  complete.o: $(srcdir)/complete.c
1686  bind.o: $(srcdir)/bind.c
1687  isearch.o: $(srcdir)/isearch.c
1688 @@ -434,6 +440,7 @@ keymaps.o: keymaps.c
1689  parens.o: parens.c
1690  search.o: search.c
1691  rltty.o: rltty.c
1692 +compat.o: compat.c
1693  complete.o: complete.c
1694  bind.o: bind.c
1695  isearch.o: isearch.c
1696 Index: readline/README
1697 ===================================================================
1698 RCS file: /prjz/.cvsroot/gdb/readline/README,v
1699 retrieving revision 1.1.1.1
1700 diff -u -3 -p -r1.1.1.1 README
1701 --- readline/README     2003/02/16 21:36:31     1.1.1.1
1702 +++ readline/README     2001/04/04 18:32:26
1703 @@ -1,7 +1,7 @@
1704  Introduction
1705  ============
1707 -This is the Gnu Readline library, version 4.1.
1708 +This is the Gnu Readline library, version 4.2.
1710  The Readline library provides a set of functions for use by applications
1711  that allow users to edit command lines as they are typed in.  Both
1712 @@ -37,6 +37,9 @@ to customize and control the build proce
1713  The file rlconf.h contains C preprocessor defines that enable and disable
1714  certain Readline features.
1716 +The special make target `everything' will build the static and shared
1717 +libraries (if the target platform supports them) and the examples.
1719  Examples
1720  ========
1722 @@ -64,8 +67,8 @@ your platform.
1723  If you need to update support/shobj-conf, you will need to create
1724  a `stanza' for your operating system and compiler.  The script uses
1725  the value of host_os and ${CC} as determined by configure.  For
1726 -instance, FreeBSD 2.2.5 with any version of gcc is identified as
1727 -`freebsd2.2.5-gcc*'.
1728 +instance, FreeBSD 4.2 using the ELF object file format  with any
1729 +version of gcc is identified as `freebsdelf4.2-gcc*'.
1731  In the stanza for your operating system-compiler pair, you will need to
1732  define several variables.  They are:
1733 @@ -144,7 +147,7 @@ Bug reports for Readline should be sent 
1735  When reporting a bug, please include the following information:
1737 -        * the version number and release status of Readline (e.g., 4.0-release)
1738 +        * the version number and release status of Readline (e.g., 4.2-release)
1739          * the machine and OS that it is running on
1740          * a list of the compilation flags or the contents of `config.h', if
1741            appropriate
1742 Index: readline/aclocal.m4
1743 ===================================================================
1744 RCS file: /prjz/.cvsroot/gdb/readline/aclocal.m4,v
1745 retrieving revision 1.1.1.1
1746 diff -u -3 -p -r1.1.1.1 aclocal.m4
1747 --- readline/aclocal.m4 2003/02/16 21:36:28     1.1.1.1
1748 +++ readline/aclocal.m4 2000/11/21 15:42:10
1749 @@ -1065,17 +1065,19 @@ fi
1750  ])
1752  AC_DEFUN(BASH_CHECK_GETPW_FUNCS,
1753 -[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions)
1754 -AC_CACHE_VAL(bash_cv_can_redecl_getpw,
1755 -[AC_TRY_COMPILE([#include <sys/types.h>
1756 +[AC_MSG_CHECKING(whether getpw functions are declared in pwd.h)
1757 +AC_CACHE_VAL(bash_cv_getpw_declared,
1758 +[AC_EGREP_CPP(getpwuid,
1760 +#include <sys/types.h>
1761 +#ifdef HAVE_UNISTD_H
1762 +#  include <unistd.h>
1763 +#endif
1764  #include <pwd.h>
1765 -extern struct passwd *getpwent();
1766 -extern struct passwd *getpwuid();
1767 -extern struct passwd *getpwnam();],
1768 -[struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");],
1769 -  bash_cv_can_redecl_getpw=yes,bash_cv_can_redecl_getpw=no)])
1770 -AC_MSG_RESULT($bash_cv_can_redecl_getpw)
1771 -if test $bash_cv_can_redecl_getpw = no; then
1773 +bash_cv_getpw_declared=yes,bash_cv_getpw_declared=no)])
1774 +AC_MSG_RESULT($bash_cv_getpw_declared)
1775 +if test $bash_cv_getpw_declared = yes; then
1776  AC_DEFINE(HAVE_GETPW_DECLS)
1777  fi
1778  ])
1779 @@ -1350,12 +1352,15 @@ dnl causes system calls to be restarted 
1780  dnl
1781  AC_DEFUN(BASH_SYS_RESTARTABLE_SYSCALLS,
1782  [AC_REQUIRE([BASH_SIGNAL_CHECK])
1783 -AC_CACHE_CHECK(for restartable system calls with posix sigaction,
1784 +AC_CACHE_CHECK(whether posix sigaction restarts system calls by default,
1785  bash_cv_sys_restartable_syscalls,
1786  [AC_TRY_RUN(
1787  [/* Exit 0 (true) if wait returns something other than -1,
1788     i.e. the pid of the child, which means that wait was restarted
1789     after getting the signal.  */
1790 +#ifdef HAVE_UNISTD_H
1791 +#  include <unistd.h>
1792 +#endif
1793  #include <sys/types.h>
1794  #include <signal.h>
1795  static int caught = 0;
1796 @@ -1423,5 +1428,36 @@ AC_EGREP_HEADER(struct timeval, sys/time
1797  AC_MSG_RESULT($bash_cv_struct_timeval)
1798  if test $bash_cv_struct_timeval = yes; then
1799    AC_DEFINE(HAVE_TIMEVAL)
1803 +AC_DEFUN(BASH_CHECK_RTSIGS,
1804 +[AC_MSG_CHECKING(for unusable real-time signals due to large values)
1805 +AC_CACHE_VAL(bash_cv_unusable_rtsigs,
1806 +[AC_TRY_RUN([
1807 +#include <sys/types.h>
1808 +#include <signal.h>
1810 +#ifndef NSIG
1811 +#  define NSIG 64
1812 +#endif
1814 +main ()
1816 +  int n_sigs = 2 * NSIG;
1817 +#ifdef SIGRTMIN
1818 +  int rtmin = SIGRTMIN;
1819 +#else
1820 +  int rtmin = 0;
1821 +#endif
1823 +  exit(rtmin < n_sigs);
1824 +}], bash_cv_unusable_rtsigs=yes, bash_cv_unusable_rtsigs=no,
1825 +    [AC_MSG_WARN(cannot check real-time signals if cross compiling -- defaulting to yes)
1826 +     bash_cv_unusable_rtsigs=yes]
1827 +)])
1828 +AC_MSG_RESULT($bash_cv_unusable_rtsigs)
1829 +if test $bash_cv_unusable_rtsigs = yes; then
1830 +AC_DEFINE(UNUSABLE_RT_SIGNALS)
1831  fi
1832  ])
1833 Index: readline/ansi_stdlib.h
1834 ===================================================================
1835 RCS file: /prjz/.cvsroot/gdb/readline/ansi_stdlib.h,v
1836 retrieving revision 1.1.1.1
1837 diff -u -3 -p -r1.1.1.1 ansi_stdlib.h
1838 --- readline/ansi_stdlib.h      2003/02/16 21:36:28     1.1.1.1
1839 +++ readline/ansi_stdlib.h      2000/09/07 16:07:49
1840 @@ -27,6 +27,9 @@
1841  extern int atoi ();
1842  extern long int atol ();
1844 +extern double atof ();
1845 +extern double strtod ();
1847  /* Memory allocation functions. */
1848  extern char *malloc ();
1849  extern char *realloc ();
1850 Index: readline/bind.c
1851 ===================================================================
1852 RCS file: /prjz/.cvsroot/gdb/readline/bind.c,v
1853 retrieving revision 1.1.1.1
1854 diff -u -3 -p -r1.1.1.1 bind.c
1855 --- readline/bind.c     2003/02/16 21:36:28     1.1.1.1
1856 +++ readline/bind.c     2003/02/17 12:47:09
1857 @@ -48,6 +48,11 @@
1858  extern int errno;
1859  #endif /* !errno */
1861 +#ifdef __MINGW32__
1862 +#include <sys/stat.h>
1863 +#include <io.h>
1864 +#endif
1866  #include "posixstat.h"
1868  /* System-specific feature definitions and include files. */
1869 @@ -68,9 +73,9 @@ extern char *strchr (), *strrchr ();
1870  /* Variables exported by this file. */
1871  Keymap rl_binding_keymap;
1873 -static int _rl_read_init_file __P((char *, int));
1874 +static int _rl_read_init_file __P((const char *, int));
1875  static int glean_key_from_name __P((char *));
1876 -static int substring_member_of_array __P((char *, char **));
1877 +static int substring_member_of_array __P((char *, const char **));
1879  static int currently_reading_init_file;
1881 @@ -83,13 +88,13 @@ static int _rl_prefer_visible_bell = 1;
1882  /*                                                                 */
1883  /* **************************************************************** */
1885 -/* rl_add_defun (char *name, Function *function, int key)
1886 +/* rl_add_defun (char *name, rl_command_func_t *function, int key)
1887     Add NAME to the list of named functions.  Make FUNCTION be the function
1888     that gets called.  If KEY is not -1, then bind it. */
1889  int
1890  rl_add_defun (name, function, key)
1891 -     char *name;
1892 -     Function *function;
1893 +     const char *name;
1894 +     rl_command_func_t *function;
1895       int key;
1897    if (key != -1)
1898 @@ -102,7 +107,7 @@ rl_add_defun (name, function, key)
1899  int
1900  rl_bind_key (key, function)
1901       int key;
1902 -     Function *function;
1903 +     rl_command_func_t *function;
1905    if (key < 0)
1906      return (key);
1907 @@ -133,7 +138,7 @@ rl_bind_key (key, function)
1908  int
1909  rl_bind_key_in_map (key, function, map)
1910       int key;
1911 -     Function *function;
1912 +     rl_command_func_t *function;
1913       Keymap map;
1915    int result;
1916 @@ -152,7 +157,7 @@ int
1917  rl_unbind_key (key)
1918       int key;
1920 -  return (rl_bind_key (key, (Function *)NULL));
1921 +  return (rl_bind_key (key, (rl_command_func_t *)NULL));
1924  /* Make KEY do nothing in MAP.
1925 @@ -162,13 +167,13 @@ rl_unbind_key_in_map (key, map)
1926       int key;
1927       Keymap map;
1929 -  return (rl_bind_key_in_map (key, (Function *)NULL, map));
1930 +  return (rl_bind_key_in_map (key, (rl_command_func_t *)NULL, map));
1933  /* Unbind all keys bound to FUNCTION in MAP. */
1934  int
1935  rl_unbind_function_in_map (func, map)
1936 -     Function *func;
1937 +     rl_command_func_t *func;
1938       Keymap map;
1940    register int i, rval;
1941 @@ -177,7 +182,7 @@ rl_unbind_function_in_map (func, map)
1942      {
1943        if (map[i].type == ISFUNC && map[i].function == func)
1944         {
1945 -         map[i].function = (Function *)NULL;
1946 +         map[i].function = (rl_command_func_t *)NULL;
1947           rval = 1;
1948         }
1949      }
1950 @@ -186,10 +191,10 @@ rl_unbind_function_in_map (func, map)
1952  int
1953  rl_unbind_command_in_map (command, map)
1954 -     char *command;
1955 +     const char *command;
1956       Keymap map;
1958 -  Function *func;
1959 +  rl_command_func_t *func;
1961    func = rl_named_function (command);
1962    if (func == 0)
1963 @@ -202,8 +207,8 @@ rl_unbind_command_in_map (command, map)
1964     place to do bindings is in MAP. */
1965  int
1966  rl_set_key (keyseq, function, map)
1967 -     char *keyseq;
1968 -     Function *function;
1969 +     const char *keyseq;
1970 +     rl_command_func_t *function;
1971       Keymap map;
1973    return (rl_generic_bind (ISFUNC, keyseq, (char *)function, map));
1974 @@ -214,7 +219,7 @@ rl_set_key (keyseq, function, map)
1975     necessary.  The initial place to do bindings is in MAP. */
1976  int
1977  rl_macro_bind (keyseq, macro, map)
1978 -     char *keyseq, *macro;
1979 +     const char *keyseq, *macro;
1980       Keymap map;
1982    char *macro_keys;
1983 @@ -239,7 +244,8 @@ rl_macro_bind (keyseq, macro, map)
1984  int
1985  rl_generic_bind (type, keyseq, data, map)
1986       int type;
1987 -     char *keyseq, *data;
1988 +     const char *keyseq;
1989 +     char *data;
1990       Keymap map;
1992    char *keys;
1993 @@ -309,7 +315,8 @@ rl_generic_bind (type, keyseq, data, map
1994     non-zero if there was an error parsing SEQ. */
1995  int
1996  rl_translate_keyseq (seq, array, len)
1997 -     char *seq, *array;
1998 +     const char *seq;
1999 +     char *array;
2000       int *len;
2002    register int i, c, l, temp;
2003 @@ -513,9 +520,9 @@ _rl_untranslate_macro_value (seq)
2004  /* Return a pointer to the function that STRING represents.
2005     If STRING doesn't have a matching function, then a NULL pointer
2006     is returned. */
2007 -Function *
2008 +rl_command_func_t *
2009  rl_named_function (string)
2010 -     char *string;
2011 +     const char *string;
2013    register int i;
2015 @@ -524,7 +531,7 @@ rl_named_function (string)
2016    for (i = 0; funmap[i]; i++)
2017      if (_rl_stricmp (funmap[i]->name, string) == 0)
2018        return (funmap[i]->function);
2019 -  return ((Function *)NULL);
2020 +  return ((rl_command_func_t *)NULL);
2023  /* Return the function (or macro) definition which would be invoked via
2024 @@ -532,9 +539,9 @@ rl_named_function (string)
2025     used.  TYPE, if non-NULL, is a pointer to an int which will receive the
2026     type of the object pointed to.  One of ISFUNC (function), ISKMAP (keymap),
2027     or ISMACR (macro). */
2028 -Function *
2029 +rl_command_func_t *
2030  rl_function_of_keyseq (keyseq, map, type)
2031 -     char *keyseq;
2032 +     const char *keyseq;
2033       Keymap map;
2034       int *type;
2036 @@ -585,14 +592,14 @@ rl_function_of_keyseq (keyseq, map, type
2037           return (map[ic].function);
2038         }
2039      }
2040 -  return ((Function *) NULL);
2041 +  return ((rl_command_func_t *) NULL);
2044  /* The last key bindings file read. */
2045  static char *last_readline_init_file = (char *)NULL;
2047  /* The file we're currently reading key bindings from. */
2048 -static char *current_readline_init_file;
2049 +static const char *current_readline_init_file;
2050  static int current_readline_init_include_level;
2051  static int current_readline_init_lineno;
2053 @@ -659,7 +666,7 @@ rl_re_read_init_file (count, ignore)
2054       int count, ignore;
2056    int r;
2057 -  r = rl_read_init_file ((char *)NULL);
2058 +  r = rl_read_init_file ((const char *)NULL);
2059    rl_set_keymap_from_edit_mode ();
2060    return r;
2062 @@ -673,14 +680,14 @@ rl_re_read_init_file (count, ignore)
2063     otherwise errno is returned. */
2064  int
2065  rl_read_init_file (filename)
2066 -     char *filename;
2067 +     const char *filename;
2069    /* Default the filename. */
2070    if (filename == 0)
2071      {
2072        filename = last_readline_init_file;
2073        if (filename == 0)
2074 -        filename = get_env_value ("INPUTRC");
2075 +        filename = sh_get_env_value ("INPUTRC");
2076        if (filename == 0)
2077         filename = DEFAULT_INPUTRC;
2078      }
2079 @@ -696,9 +703,13 @@ rl_read_init_file (filename)
2080    return (_rl_read_init_file (filename, 0));
2083 +#ifdef __MINGW32__
2084 +extern char *get_user_registry_string(char *keyName, char* valName);
2085 +#endif
2087  static int
2088  _rl_read_init_file (filename, include_level)
2089 -     char *filename;
2090 +     const char *filename;
2091       int include_level;
2093    register int i;
2094 @@ -712,6 +723,18 @@ _rl_read_init_file (filename, include_le
2095    buffer = _rl_read_file (openname, &file_size);
2096    free (openname);
2098 +#if defined (__MINGW32__) && defined (INITFILES_IN_REGISTRY)
2099 +  if (buffer == 0)
2100 +    {
2101 +      openname = get_user_registry_string(READLINE_REGKEY, INPUTRC_REGVAL);
2102 +      if (openname)
2103 +        {
2104 +          buffer = _rl_read_file (openname, &file_size);
2105 +          free (openname);
2106 +        }
2107 +    }
2108 +#endif /* __MINGW32__ */
2110    if (buffer == 0)
2111      return (errno);
2112    
2113 @@ -733,7 +756,7 @@ _rl_read_init_file (filename, include_le
2114        /* Find the end of this line. */
2115        for (i = 0; line + i != end && line[i] != '\n'; i++);
2117 -#if defined (__CYGWIN32__)
2118 +#if defined (__CYGWIN__)
2119        /* ``Be liberal in what you accept.'' */
2120        if (line[i] == '\n' && line[i-1] == '\r')
2121         line[i - 1] = '\0';
2122 @@ -780,10 +803,21 @@ _rl_init_file_error (msg)
2123  /*                                                                 */
2124  /* **************************************************************** */
2126 +typedef int _rl_parser_func_t __P((char *));
2128 +/* Things that mean `Control'. */
2129 +const char *_rl_possible_control_prefixes[] = {
2130 +  "Control-", "C-", "CTRL-", (const char *)NULL
2133 +const char *_rl_possible_meta_prefixes[] = {
2134 +  "Meta", "M-", (const char *)NULL
2137  /* Conditionals. */
2139  /* Calling programs set this to have their argv[0]. */
2140 -char *rl_readline_name = "other";
2141 +const char *rl_readline_name = "other";
2143  /* Stack of previous values of parsing_conditionalized_out. */
2144  static unsigned char *if_stack = (unsigned char *)NULL;
2145 @@ -905,7 +939,8 @@ static int
2146  parser_include (args)
2147       char *args;
2149 -  char *old_init_file, *e;
2150 +  const char *old_init_file;
2151 +  char *e;
2152    int old_line_number, old_include_level, r;
2154    if (_rl_parsing_conditionalized_out)
2155 @@ -918,7 +953,7 @@ parser_include (args)
2156    e = strchr (args, '\n');
2157    if (e)
2158      *e = '\0';
2159 -  r = _rl_read_init_file (args, old_include_level + 1);
2160 +  r = _rl_read_init_file ((const char *)args, old_include_level + 1);
2162    current_readline_init_file = old_init_file;
2163    current_readline_init_lineno = old_line_number;
2164 @@ -929,14 +964,14 @@ parser_include (args)
2165    
2166  /* Associate textual names with actual functions. */
2167  static struct {
2168 -  char *name;
2169 -  Function *function;
2170 +  const char *name;
2171 +  _rl_parser_func_t *function;
2172  } parser_directives [] = {
2173    { "if", parser_if },
2174    { "endif", parser_endif },
2175    { "else", parser_else },
2176    { "include", parser_include },
2177 -  { (char *)0x0, (Function *)0x0 }
2178 +  { (char *)0x0, (_rl_parser_func_t *)0x0 }
2179  };
2181  /* Handle a parser directive.  STATEMENT is the line of the directive
2182 @@ -1180,10 +1215,10 @@ rl_parse_and_bind (string)
2183    key = glean_key_from_name (kname);
2185    /* Add in control and meta bits. */
2186 -  if (substring_member_of_array (string, possible_control_prefixes))
2187 +  if (substring_member_of_array (string, _rl_possible_control_prefixes))
2188      key = CTRL (_rl_to_upper (key));
2190 -  if (substring_member_of_array (string, possible_meta_prefixes))
2191 +  if (substring_member_of_array (string, _rl_possible_meta_prefixes))
2192      key = META (key);
2194    /* Temporary.  Handle old-style keyname with macro-binding. */
2195 @@ -1221,7 +1256,7 @@ rl_parse_and_bind (string)
2196  #define V_SPECIAL      0x1
2198  static struct {
2199 -  char *name;
2200 +  const char *name;
2201    int *value;
2202    int flags;
2203  } boolean_varlist [] = {
2204 @@ -1265,7 +1300,7 @@ static void
2205  hack_special_boolean_var (i)
2206       int i;
2208 -  char *name;
2209 +  const char *name;
2211    name = boolean_varlist[i].name;
2213 @@ -1280,6 +1315,8 @@ hack_special_boolean_var (i)
2214      }
2217 +typedef int _rl_sv_func_t __P((const char *));
2219  /* These *must* correspond to the array indices for the appropriate
2220     string variable.  (Though they're not used right now.) */
2221  #define V_BELLSTYLE    0
2222 @@ -1292,17 +1329,17 @@ hack_special_boolean_var (i)
2223  #define V_INT          2
2225  /* Forward declarations */
2226 -static int sv_bell_style __P((char *));
2227 -static int sv_combegin __P((char *));
2228 -static int sv_compquery __P((char *));
2229 -static int sv_editmode __P((char *));
2230 -static int sv_isrchterm __P((char *));
2231 -static int sv_keymap __P((char *));
2232 +static int sv_bell_style __P((const char *));
2233 +static int sv_combegin __P((const char *));
2234 +static int sv_compquery __P((const char *));
2235 +static int sv_editmode __P((const char *));
2236 +static int sv_isrchterm __P((const char *));
2237 +static int sv_keymap __P((const char *));
2239  static struct {
2240 -  char *name;
2241 +  const char *name;
2242    int flags;
2243 -  Function *set_func;
2244 +  _rl_sv_func_t *set_func;
2245  } string_varlist[] = {
2246    { "bell-style",      V_STRING,       sv_bell_style },
2247    { "comment-begin",   V_STRING,       sv_combegin },
2248 @@ -1339,7 +1376,7 @@ bool_to_int (value)
2250  int
2251  rl_variable_bind (name, value)
2252 -     char *name, *value;
2253 +     const char *name, *value;
2255    register int i;
2256    int  v;
2257 @@ -1367,7 +1404,7 @@ rl_variable_bind (name, value)
2259  static int
2260  sv_editmode (value)
2261 -     char *value;
2262 +     const char *value;
2264    if (_rl_strnicmp (value, "vi", 2) == 0)
2265      {
2266 @@ -1388,7 +1425,7 @@ sv_editmode (value)
2268  static int
2269  sv_combegin (value)
2270 -     char *value;
2271 +     const char *value;
2273    if (value && *value)
2274      {
2275 @@ -1401,7 +1438,7 @@ sv_combegin (value)
2277  static int
2278  sv_compquery (value)
2279 -     char *value;
2280 +     const char *value;
2282    int nval = 100;
2284 @@ -1417,7 +1454,7 @@ sv_compquery (value)
2286  static int
2287  sv_keymap (value)
2288 -     char *value;
2289 +     const char *value;
2291    Keymap kmap;
2293 @@ -1434,7 +1471,7 @@ sv_keymap (value)
2295  static int
2296  sv_bell_style (value)
2297 -     char *value;
2298 +     const char *value;
2300    if (value == 0 || *value == '\0')
2301      _SET_BELL (AUDIBLE_BELL);
2302 @@ -1451,7 +1488,7 @@ sv_bell_style (value)
2304  static int
2305  sv_isrchterm (value)
2306 -     char *value;
2307 +     const char *value;
2309    int beg, end, delim;
2310    char *v;
2311 @@ -1489,7 +1526,7 @@ sv_isrchterm (value)
2312     For example, `Space' returns ' '. */
2314  typedef struct {
2315 -  char *name;
2316 +  const char *name;
2317    int value;
2318  } assoc_list;
2320 @@ -1523,7 +1560,7 @@ glean_key_from_name (name)
2322  /* Auxiliary functions to manage keymaps. */
2323  static struct {
2324 -  char *name;
2325 +  const char *name;
2326    Keymap map;
2327  } keymap_names[] = {
2328    { "emacs", emacs_standard_keymap },
2329 @@ -1541,12 +1578,12 @@ static struct {
2331  Keymap
2332  rl_get_keymap_by_name (name)
2333 -     char *name;
2334 +     const char *name;
2336    register int i;
2338    for (i = 0; keymap_names[i].name; i++)
2339 -    if (strcmp (name, keymap_names[i].name) == 0)
2340 +    if (_rl_stricmp (name, keymap_names[i].name) == 0)
2341        return (keymap_names[i].map);
2342    return ((Keymap) NULL);
2344 @@ -1558,7 +1595,7 @@ rl_get_keymap_name (map)
2345    register int i;
2346    for (i = 0; keymap_names[i].name; i++)
2347      if (map == keymap_names[i].map)
2348 -      return (keymap_names[i].name);
2349 +      return ((char *)keymap_names[i].name);
2350    return ((char *)NULL);
2352    
2353 @@ -1616,7 +1653,7 @@ void
2354  rl_list_funmap_names ()
2356    register int i;
2357 -  char **funmap_names;
2358 +  const char **funmap_names;
2360    funmap_names = rl_funmap_names ();
2362 @@ -1706,7 +1743,7 @@ _rl_get_keyname (key)
2363     sequences that are used to invoke FUNCTION in MAP. */
2364  char **
2365  rl_invoking_keyseqs_in_map (function, map)
2366 -     Function *function;
2367 +     rl_command_func_t *function;
2368       Keymap map;
2370    register int key;
2371 @@ -1806,7 +1843,7 @@ rl_invoking_keyseqs_in_map (function, ma
2372     sequences that can be used to invoke FUNCTION using the current keymap. */
2373  char **
2374  rl_invoking_keyseqs (function)
2375 -     Function *function;
2376 +     rl_command_func_t *function;
2378    return (rl_invoking_keyseqs_in_map (function, _rl_keymap));
2380 @@ -1819,8 +1856,8 @@ rl_function_dumper (print_readably)
2381       int print_readably;
2383    register int i;
2384 -  char **names;
2385 -  char *name;
2386 +  const char **names;
2387 +  const char *name;
2389    names = rl_funmap_names ();
2391 @@ -1828,7 +1865,7 @@ rl_function_dumper (print_readably)
2393    for (i = 0; name = names[i]; i++)
2394      {
2395 -      Function *function;
2396 +      rl_command_func_t *function;
2397        char **invokers;
2399        function = rl_named_function (name);
2400 @@ -1985,7 +2022,7 @@ rl_variable_dumper (print_readably)
2401       int print_readably;
2403    int i;
2404 -  char *kname;
2405 +  const char *kname;
2407    for (i = 0; boolean_varlist[i].name; i++)
2408      {
2409 @@ -2073,10 +2110,10 @@ rl_dump_variables (count, key)
2410  /* Bind key sequence KEYSEQ to DEFAULT_FUNC if KEYSEQ is unbound. */
2411  void
2412  _rl_bind_if_unbound (keyseq, default_func)
2413 -     char *keyseq;
2414 -     Function *default_func;
2415 +     const char *keyseq;
2416 +     rl_command_func_t *default_func;
2418 -  Function *func;
2419 +  rl_command_func_t *func;
2421    if (keyseq)
2422      {
2423 @@ -2089,7 +2126,8 @@ _rl_bind_if_unbound (keyseq, default_fun
2424  /* Return non-zero if any members of ARRAY are a substring in STRING. */
2425  static int
2426  substring_member_of_array (string, array)
2427 -     char *string, **array;
2428 +     char *string;
2429 +     const char **array;
2431    while (*array)
2432      {
2433 Index: readline/callback.c
2434 ===================================================================
2435 RCS file: /prjz/.cvsroot/gdb/readline/callback.c,v
2436 retrieving revision 1.1.1.1
2437 diff -u -3 -p -r1.1.1.1 callback.c
2438 --- readline/callback.c 2003/02/16 21:36:29     1.1.1.1
2439 +++ readline/callback.c 2003/02/17 12:47:09
2440 @@ -31,6 +31,7 @@
2442  #include <sys/types.h>
2443  #include <stdio.h>
2444 +#include <stdlib.h>
2446  /* System-specific feature definitions and include files. */
2447  #include "rldefs.h"
2448 @@ -52,7 +53,7 @@
2449     text read in at each end of line.  The terminal is kept prepped and
2450     signals handled all the time, except during calls to the user's function. */
2452 -VFunction *rl_linefunc;                /* user callback function */
2453 +rl_vcpfunc_t *rl_linefunc;             /* user callback function */
2454  static int in_handler;         /* terminal_prepped and signals set? */
2456  /* Make sure the terminal is set up, initialize readline, and prompt. */
2457 @@ -78,11 +79,10 @@ _rl_callback_newline ()
2458  /* Install a readline handler, set up the terminal, and issue the prompt. */
2459  void
2460  rl_callback_handler_install (prompt, linefunc)
2461 -     char *prompt;
2462 -     VFunction *linefunc;
2463 +     const char *prompt;
2464 +     rl_vcpfunc_t *linefunc;
2466 -  rl_prompt = prompt;
2467 -  rl_visible_prompt_length = rl_prompt ? rl_expand_prompt (rl_prompt) : 0;
2468 +  rl_set_prompt (prompt);
2469    rl_linefunc = linefunc;
2470    _rl_callback_newline ();
2472 @@ -102,24 +102,33 @@ rl_callback_read_char ()
2474    eof = readline_internal_char ();
2476 -  if (rl_done)
2477 +  /* We loop in case some function has pushed input back with rl_execute_next. */
2478 +  for (;;)
2479      {
2480 -      line = readline_internal_teardown (eof);
2481 +      if (rl_done)
2482 +       {
2483 +         line = readline_internal_teardown (eof);
2485 -      (*rl_deprep_term_function) ();
2486 +         (*rl_deprep_term_function) ();
2487  #if defined (HANDLE_SIGNALS)
2488 -      rl_clear_signals ();
2489 +         rl_clear_signals ();
2490  #endif
2491 -      in_handler = 0;
2492 -      (*rl_linefunc) (line);
2493 +         in_handler = 0;
2494 +         (*rl_linefunc) (line);
2496 -    /* If the user did not clear out the line, do it for him. */
2497 -    if (rl_line_buffer[0])
2498 -      _rl_init_line_state ();
2500 -    /* Redisplay the prompt if readline_handler_{install,remove} not called. */
2501 -      if (in_handler == 0 && rl_linefunc)
2502 -       _rl_callback_newline ();
2503 +         /* If the user did not clear out the line, do it for him. */
2504 +         if (rl_line_buffer[0])
2505 +           _rl_init_line_state ();
2507 +         /* Redisplay the prompt if readline_handler_{install,remove}
2508 +            not called. */
2509 +         if (in_handler == 0 && rl_linefunc)
2510 +           _rl_callback_newline ();
2511 +       }
2512 +      if (rl_pending_input)
2513 +       eof = readline_internal_char ();
2514 +      else
2515 +        break;
2516      }
2519 Index: readline/chardefs.h
2520 ===================================================================
2521 RCS file: /prjz/.cvsroot/gdb/readline/chardefs.h,v
2522 retrieving revision 1.1.1.1
2523 diff -u -3 -p -r1.1.1.1 chardefs.h
2524 --- readline/chardefs.h 2003/02/16 21:36:29     1.1.1.1
2525 +++ readline/chardefs.h 2003/02/17 12:47:09
2526 @@ -46,12 +46,19 @@
2527  /* Some character stuff. */
2528  #define control_character_threshold 0x020   /* Smaller than this is control. */
2529  #define control_character_mask 0x1f        /* 0x20 - 1 */
2530 -#define meta_character_threshold 0x07f     /* Larger than this is Meta. */
2531  #define control_character_bit 0x40         /* 0x000000, must be off. */
2533 +#ifndef __MINGW32__
2534 +#define meta_character_threshold 0x07f     /* Larger than this is Meta. */
2535  #define meta_character_bit 0x080           /* x0000000, must be on. */
2536  #define largest_char 255                   /* Largest character value. */
2537 +#else
2538 +#define meta_character_threshold 0x0ff     /* Larger than this is Meta. */
2539 +#define meta_character_bit 0x100           /* x0000000, must be on. */
2540 +#define largest_char 0x1ff                 /* Largest character value. */
2541 +#endif
2543 -#define CTRL_CHAR(c) ((c) < control_character_threshold && (c) >= 0)
2544 +#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
2545  #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
2547  #define CTRL(c) ((c) & control_character_mask)
2548 Index: readline/complete.c
2549 ===================================================================
2550 RCS file: /prjz/.cvsroot/gdb/readline/complete.c,v
2551 retrieving revision 1.1.1.1
2552 diff -u -3 -p -r1.1.1.1 complete.c
2553 --- readline/complete.c 2003/02/16 21:36:29     1.1.1.1
2554 +++ readline/complete.c 2003/02/17 12:47:09
2555 @@ -42,25 +42,19 @@
2556  #endif /* HAVE_STDLIB_H */
2558  #include <stdio.h>
2559 +#ifdef __MINGW32__
2560 +# include <windows.h>
2561 +# include <io.h>
2562 +#endif
2564  #include <errno.h>
2565  #if !defined (errno)
2566  extern int errno;
2567  #endif /* !errno */
2569 +#ifndef __MINGW32__
2570  #include <pwd.h>
2571 -#if !defined (HAVE_GETPW_DECLS)
2572 -extern struct passwd *getpwent ();
2573 -#endif /* USG && !HAVE_GETPW_DECLS */
2575 -/* ISC systems don't define getpwent() if _POSIX_SOURCE is defined. */
2576 -#if defined (isc386) && defined (_POSIX_SOURCE)
2577 -#  if defined (__STDC__)
2578 -extern struct passwd *getpwent (void);
2579 -#  else
2580 -extern struct passwd *getpwent ();
2581 -#  endif /* !__STDC__ */
2582 -#endif /* isc386 && _POSIX_SOURCE */
2583 +#endif
2585  #include "posixdir.h"
2586  #include "posixstat.h"
2587 @@ -79,6 +73,12 @@ typedef int QSFUNC (const void *, const 
2588  typedef int QSFUNC ();
2589  #endif
2591 +/* Most systems don't declare getpwent in <pwd.h> if _POSIX_SOURCE is
2592 +   defined. */
2593 +#if !defined (HAVE_GETPW_DECLS) || defined (_POSIX_SOURCE)
2594 +extern struct passwd *getpwent __P((void));
2595 +#endif /* !HAVE_GETPW_DECLS || _POSIX_SOURCE */
2597  /* If non-zero, then this is the address of a function to call when
2598     completing a word would normally display the list of possible matches.
2599     This function is called instead of actually doing the display.
2600 @@ -86,11 +86,7 @@ typedef int QSFUNC ();
2601     where MATCHES is the array of strings that matched, NUM_MATCHES is the
2602     number of strings in that array, and MAX_LENGTH is the length of the
2603     longest string in that array. */
2604 -VFunction *rl_completion_display_matches_hook = (VFunction *)NULL;
2606 -/* Forward declarations for functions defined and used in this file. */
2607 -char *filename_completion_function __P((char *, int));
2608 -char **completion_matches __P((char *, CPFunction *));
2609 +rl_compdisp_func_t *rl_completion_display_matches_hook = (rl_compdisp_func_t *)NULL;
2611  #if defined (VISIBLE_STATS)
2612  #  if !defined (X_OK)
2613 @@ -100,14 +96,13 @@ static int stat_char __P((char *));
2614  #endif
2616  static char *rl_quote_filename __P((char *, int, char *));
2617 -static char *rl_strpbrk __P((char *, char *));
2619  static char **remove_duplicate_matches __P((char **));
2620  static void insert_match __P((char *, int, int, char *));
2621  static int append_to_match __P((char *, int, int));
2622  static void insert_all_matches __P((char **, int, char *));
2623  static void display_matches __P((char **));
2624 -static int compute_lcd_of_matches __P((char **, int, char *));
2625 +static int compute_lcd_of_matches __P((char **, int, const char *));
2627  /* **************************************************************** */
2628  /*                                                                 */
2629 @@ -146,15 +141,17 @@ int rl_visible_stats = 0;
2630  /* If non-zero, then this is the address of a function to call when
2631     completing on a directory name.  The function is called with
2632     the address of a string (the current directory name) as an arg. */
2633 -Function *rl_directory_completion_hook = (Function *)NULL;
2634 +rl_icppfunc_t *rl_directory_completion_hook = (rl_icppfunc_t *)NULL;
2636 +rl_icppfunc_t *rl_directory_rewrite_hook = (rl_icppfunc_t *)NULL;
2638  /* Non-zero means readline completion functions perform tilde expansion. */
2639  int rl_complete_with_tilde_expansion = 0;
2641  /* Pointer to the generator function for completion_matches ().
2642 -   NULL means to use filename_completion_function (), the default filename
2643 +   NULL means to use rl_filename_completion_function (), the default filename
2644     completer. */
2645 -Function *rl_completion_entry_function = (Function *)NULL;
2646 +rl_compentry_func_t *rl_completion_entry_function = (rl_compentry_func_t *)NULL;
2648  /* Pointer to alternative function to create matches.
2649     Function is called with TEXT, START, and END.
2650 @@ -163,7 +160,7 @@ Function *rl_completion_entry_function =
2651     If this function exists and returns NULL then call the value of
2652     rl_completion_entry_function to try to match, otherwise use the
2653     array of strings returned. */
2654 -CPPFunction *rl_attempted_completion_function = (CPPFunction *)NULL;
2655 +rl_completion_func_t *rl_attempted_completion_function = (rl_completion_func_t *)NULL;
2657  /* Non-zero means to suppress normal filename completion after the
2658     user-specified completion function has been called. */
2659 @@ -182,29 +179,29 @@ int rl_completion_query_items = 100;
2660  /* The basic list of characters that signal a break between words for the
2661     completer routine.  The contents of this variable is what breaks words
2662     in the shell, i.e. " \t\n\"\\'`@$><=" */
2663 -char *rl_basic_word_break_characters = " \t\n\"\\'`@$><=;|&{(";
2664 +const char *rl_basic_word_break_characters = " \t\n\"\\'`@$><=;|&{(";
2666  /* List of basic quoting characters. */
2667 -char *rl_basic_quote_characters = "\"'";
2668 +const char *rl_basic_quote_characters = "\"'";
2670  /* The list of characters that signal a break between words for
2671     rl_complete_internal.  The default list is the contents of
2672     rl_basic_word_break_characters.  */
2673 -char *rl_completer_word_break_characters = (char *)NULL;
2674 +const char *rl_completer_word_break_characters = (const char *)NULL;
2676  /* List of characters which can be used to quote a substring of the line.
2677     Completion occurs on the entire substring, and within the substring
2678     rl_completer_word_break_characters are treated as any other character,
2679     unless they also appear within this list. */
2680 -char *rl_completer_quote_characters = (char *)NULL;
2681 +const char *rl_completer_quote_characters = (const char *)NULL;
2683  /* List of characters that should be quoted in filenames by the completer. */
2684 -char *rl_filename_quote_characters = (char *)NULL;
2685 +const char *rl_filename_quote_characters = (const char *)NULL;
2687  /* List of characters that are word break characters, but should be left
2688     in TEXT when it is passed to the completion function.  The shell uses
2689     this to help determine what kind of completing to do. */
2690 -char *rl_special_prefixes = (char *)NULL;
2691 +const char *rl_special_prefixes = (const char *)NULL;
2693  /* If non-zero, then disallow duplicates in the matches. */
2694  int rl_ignore_completion_duplicates = 1;
2695 @@ -230,24 +227,24 @@ int rl_filename_quoting_desired = 1;
2696     the list of matches as required, but all elements of the array must be
2697     free()'d if they are deleted. The main intent of this function is
2698     to implement FIGNORE a la SunOS csh. */
2699 -Function *rl_ignore_some_completions_function = (Function *)NULL;
2700 +rl_compignore_func_t *rl_ignore_some_completions_function = (rl_compignore_func_t *)NULL;
2702  /* Set to a function to quote a filename in an application-specific fashion.
2703     Called with the text to quote, the type of match found (single or multiple)
2704     and a pointer to the quoting character to be used, which the function can
2705     reset if desired. */
2706 -CPFunction *rl_filename_quoting_function = rl_quote_filename;
2707 +rl_quote_func_t *rl_filename_quoting_function = rl_quote_filename;
2708           
2709  /* Function to call to remove quoting characters from a filename.  Called
2710     before completion is attempted, so the embedded quotes do not interfere
2711     with matching names in the file system.  Readline doesn't do anything
2712     with this; it's set only by applications. */
2713 -CPFunction *rl_filename_dequoting_function = (CPFunction *)NULL;
2714 +rl_dequote_func_t *rl_filename_dequoting_function = (rl_dequote_func_t *)NULL;
2716  /* Function to call to decide whether or not a word break character is
2717     quoted.  If a character is quoted, it does not break words for the
2718     completer. */
2719 -Function *rl_char_is_quoted_p = (Function *)NULL;
2720 +rl_linebuf_func_t *rl_char_is_quoted_p = (rl_linebuf_func_t *)NULL;
2722  /* Character appended to completed words when at the end of the line.  The
2723     default is a space. */
2724 @@ -269,7 +266,7 @@ static int completion_changed_buffer;
2726  /* Complete the word at or before point.  You have supplied the function
2727     that does the initial simple matching selection algorithm (see
2728 -   completion_matches ()).  The default is to do filename completion. */
2729 +   rl_completion_matches ()).  The default is to do filename completion. */
2730  int
2731  rl_complete (ignore, invoking_key)
2732       int ignore, invoking_key;
2733 @@ -305,27 +302,6 @@ rl_insert_completions (ignore, invoking_
2734  /*                                 */
2735  /************************************/
2737 -/* Find the first occurrence in STRING1 of any character from STRING2.
2738 -   Return a pointer to the character in STRING1. */
2739 -static char *
2740 -rl_strpbrk (string1, string2)
2741 -     char *string1, *string2;
2743 -  register char *scan;
2745 -  for (; *string1; string1++)
2746 -    {
2747 -      for (scan = string2; *scan; scan++)
2748 -       {
2749 -         if (*string1 == *scan)
2750 -           {
2751 -             return (string1);
2752 -           }
2753 -       }
2754 -    }
2755 -  return ((char *)NULL);
2758  /* The user must press "y" or "n". Non-zero return means "y" pressed. */
2759  static int
2760  get_y_or_n ()
2761 @@ -334,14 +310,17 @@ get_y_or_n ()
2763    for (;;)
2764      {
2765 +      RL_SETSTATE(RL_STATE_MOREINPUT);
2766        c = rl_read_key ();
2767 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
2769        if (c == 'y' || c == 'Y' || c == ' ')
2770         return (1);
2771        if (c == 'n' || c == 'N' || c == RUBOUT)
2772         return (0);
2773        if (c == ABORT_CHAR)
2774         _rl_abort_internal ();
2775 -      ding ();
2776 +      rl_ding ();
2777      }
2780 @@ -571,7 +550,11 @@ find_completion_word (fp, dp)
2781               continue;
2782             }
2784 -         if (rl_line_buffer[scan] == '\\')
2785 +         /* Shell-like semantics for single quotes -- don't allow backslash
2786 +            to quote anything in single quotes, especially not the closing
2787 +            quote.  If you don't like this, take out the check on the value
2788 +            of quote_char. */
2789 +         if (quote_char != '\'' && rl_line_buffer[scan] == '\\')
2790             {
2791               pass_next = 1;
2792               found_quote |= RL_QF_BACKSLASH;
2793 @@ -671,7 +654,7 @@ static char **
2794  gen_completion_matches (text, start, end, our_func, found_quote, quote_char)
2795       char *text;
2796       int start, end;
2797 -     Function *our_func;
2798 +     rl_compentry_func_t *our_func;
2799       int found_quote, quote_char;
2801    char **matches, *temp;
2802 @@ -695,7 +678,7 @@ gen_completion_matches (text, start, end
2803       filename dequoting function. */
2804    temp = (char *)NULL;
2806 -  if (found_quote && our_func == (Function *)filename_completion_function &&
2807 +  if (found_quote && our_func == rl_filename_completion_function &&
2808        rl_filename_dequoting_function)
2809      {
2810        /* delete single and double quotes */
2811 @@ -703,7 +686,7 @@ gen_completion_matches (text, start, end
2812        text = temp;     /* not freeing text is not a memory leak */
2813      }
2815 -  matches = completion_matches (text, (CPFunction *)our_func);
2816 +  matches = rl_completion_matches (text, our_func);
2817    FREE (temp);
2818    return matches;  
2820 @@ -775,7 +758,7 @@ static int
2821  compute_lcd_of_matches (match_list, matches, text)
2822       char **match_list;
2823       int matches;
2824 -     char *text;
2825 +     const char *text;
2827    register int i, c1, c2, si;
2828    int low;             /* Count of max-matched characters. */
2829 @@ -901,11 +884,11 @@ rl_display_match_list (matches, len, max
2831    /* How many items of MAX length can we fit in the screen window? */
2832    max += 2;
2833 -  limit = screenwidth / max;
2834 -  if (limit != 1 && (limit * max == screenwidth))
2835 +  limit = _rl_screenwidth / max;
2836 +  if (limit != 1 && (limit * max == _rl_screenwidth))
2837      limit--;
2839 -  /* Avoid a possible floating exception.  If max > screenwidth,
2840 +  /* Avoid a possible floating exception.  If max > _rl_screenwidth,
2841       limit will be 0 and a divide-by-zero fault will result. */
2842    if (limit == 0)
2843      limit = 1;
2844 @@ -921,7 +904,7 @@ rl_display_match_list (matches, len, max
2845    if (rl_ignore_completion_duplicates == 0)
2846      qsort (matches + 1, len, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
2848 -  crlf ();
2849 +  rl_crlf ();
2851    if (_rl_print_completions_horizontally == 0)
2852      {
2853 @@ -943,7 +926,7 @@ rl_display_match_list (matches, len, max
2854                 }
2855               l += count;
2856             }
2857 -         crlf ();
2858 +         rl_crlf ();
2859         }
2860      }
2861    else
2862 @@ -957,13 +940,13 @@ rl_display_match_list (matches, len, max
2863           if (matches[i+1])
2864             {
2865               if (i && (limit > 1) && (i % limit) == 0)
2866 -               crlf ();
2867 +               rl_crlf ();
2868               else
2869                 for (k = 0; k < max - printed_len; k++)
2870                   putc (' ', rl_outstream);
2871             }
2872         }
2873 -      crlf ();
2874 +      rl_crlf ();
2875      }
2878 @@ -992,9 +975,9 @@ display_matches (matches)
2879    if (matches[1] == 0)
2880      {
2881        temp = printable_part (matches[0]);
2882 -      crlf ();
2883 +      rl_crlf ();
2884        print_filename (temp, matches[0]);
2885 -      crlf ();
2886 +      rl_crlf ();
2888        rl_forced_update_display ();
2889        rl_display_fixed = 1;
2890 @@ -1026,12 +1009,12 @@ display_matches (matches)
2891       see them all. */
2892    if (len >= rl_completion_query_items)
2893      {
2894 -      crlf ();
2895 +      rl_crlf ();
2896        fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
2897        fflush (rl_outstream);
2898        if (get_y_or_n () == 0)
2899         {
2900 -         crlf ();
2901 +         rl_crlf ();
2903           rl_forced_update_display ();
2904           rl_display_fixed = 1;
2905 @@ -1079,7 +1062,7 @@ make_quoted_replacement (match, mtype, q
2906           This also checks whether the common prefix of several
2907          matches needs to be quoted. */
2908        should_quote = rl_filename_quote_characters
2909 -                       ? (rl_strpbrk (match, rl_filename_quote_characters) != 0)
2910 +                       ? (_rl_strpbrk (match, rl_filename_quote_characters) != 0)
2911                         : 0;
2913        do_replace = should_quote ? mtype : NO_MATCH;
2914 @@ -1232,11 +1215,12 @@ rl_complete_internal (what_to_do)
2915       int what_to_do;
2917    char **matches;
2918 -  Function *our_func;
2919 +  rl_compentry_func_t *our_func;
2920    int start, end, delimiter, found_quote, i;
2921    char *text, *saved_line_buffer;
2922    char quote_char;
2924 +  RL_SETSTATE(RL_STATE_COMPLETING);
2925    /* Only the completion entry function can change these. */
2926    rl_filename_completion_desired = 0;
2927    rl_filename_quoting_desired = 1;
2928 @@ -1245,7 +1229,7 @@ rl_complete_internal (what_to_do)
2929    saved_line_buffer = rl_line_buffer ? savestring (rl_line_buffer) : (char *)NULL;
2930    our_func = rl_completion_entry_function
2931                 ? rl_completion_entry_function
2932 -               : (Function *)filename_completion_function;
2933 +               : rl_filename_completion_function;
2935    /* We now look backwards for the start of a filename/variable word. */
2936    end = rl_point;
2937 @@ -1266,27 +1250,23 @@ rl_complete_internal (what_to_do)
2939    if (matches == 0)
2940      {
2941 -      ding ();
2942 +      rl_ding ();
2943        FREE (saved_line_buffer);
2944 +      RL_UNSETSTATE(RL_STATE_COMPLETING);
2945        return (0);
2946      }
2948 -#if 0
2949 -  /* If we are matching filenames, our_func will have been set to
2950 -     filename_completion_function */
2951 -  i = our_func == (Function *)filename_completion_function;
2952 -#else
2953    /* If we are matching filenames, the attempted completion function will
2954       have set rl_filename_completion_desired to a non-zero value.  The basic
2955 -     filename_completion_function does this. */
2956 +     rl_filename_completion_function does this. */
2957    i = rl_filename_completion_desired;
2958 -#endif
2960    if (postprocess_matches (&matches, i) == 0)
2961      {
2962 -      ding ();
2963 +      rl_ding ();
2964        FREE (saved_line_buffer);
2965        completion_changed_buffer = 0;
2966 +      RL_UNSETSTATE(RL_STATE_COMPLETING);
2967        return (0);
2968      }
2970 @@ -1314,7 +1294,7 @@ rl_complete_internal (what_to_do)
2971               break;
2972             }
2973           else if (rl_editing_mode != vi_mode)
2974 -           ding ();    /* There are other matches remaining. */
2975 +           rl_ding (); /* There are other matches remaining. */
2976         }
2977        else
2978         append_to_match (matches[0], delimiter, quote_char);
2979 @@ -1331,8 +1311,9 @@ rl_complete_internal (what_to_do)
2981      default:
2982        fprintf (stderr, "\r\nreadline: bad value %d for what_to_do in rl_complete\n", what_to_do);
2983 -      ding ();
2984 +      rl_ding ();
2985        FREE (saved_line_buffer);
2986 +      RL_UNSETSTATE(RL_STATE_COMPLETING);
2987        return 1;
2988      }
2990 @@ -1345,6 +1326,7 @@ rl_complete_internal (what_to_do)
2991        free (saved_line_buffer);
2992      }
2994 +  RL_UNSETSTATE(RL_STATE_COMPLETING);
2995    return 0;
2998 @@ -1367,9 +1349,9 @@ rl_complete_internal (what_to_do)
2999       when there are no more matches.
3000   */
3001  char **
3002 -completion_matches (text, entry_function)
3003 -     char *text;
3004 -     CPFunction *entry_function;
3005 +rl_completion_matches (text, entry_function)
3006 +     const char *text;
3007 +     rl_compentry_func_t *entry_function;
3009    /* Number of slots in match_list. */
3010    int match_list_size;
3011 @@ -1414,15 +1396,20 @@ completion_matches (text, entry_function
3012     TEXT contains a partial username preceded by a random
3013     character (usually `~').  */
3014  char *
3015 -username_completion_function (text, state)
3016 -     char *text;
3017 +rl_username_completion_function (text, state)
3018 +     const char *text;
3019       int state;
3021  #if defined (__WIN32__) || defined (__OPENNT)
3022    return (char *)NULL;
3023  #else /* !__WIN32__ && !__OPENNT) */
3024    static char *username = (char *)NULL;
3025 +#ifndef __MINGW32__
3026    static struct passwd *entry;
3027 +#else
3028 +  char UserName[128];
3029 +  unsigned UserLen;
3030 +#endif
3031    static int namelen, first_char, first_char_loc;
3032    char *value;
3034 @@ -1435,9 +1422,12 @@ username_completion_function (text, stat
3036        username = savestring (&text[first_char_loc]);
3037        namelen = strlen (username);
3038 +#ifndef __MINGW32__
3039        setpwent ();
3040 +#endif
3041      }
3043 +#ifndef __MINGW32__
3044    while (entry = getpwent ())
3045      {
3046        /* Null usernames should result in all users as possible completions. */
3047 @@ -1463,6 +1453,21 @@ username_completion_function (text, stat
3049        return (value);
3050      }
3051 +#else /* __MINGW32__ */
3052 +  if (GetUserName (UserName, &UserLen))
3053 +    {
3054 +      if (namelen == 0 || (!strnicmp (username, UserName, namelen)))
3055 +       {
3056 +         value = xmalloc (2 + strlen (UserName));
3057 +         *value = *text;
3058 +         strcpy (value + first_char_loc, UserName);
3059 +         if (first_char == '~')
3060 +           rl_filename_completion_desired = 1;
3061 +         return (value);
3062 +       }
3063 +    }
3064 +  return ((char *)NULL);
3065 +#endif /* __MINGW32__ */
3066  #endif /* !__WIN32__ && !__OPENNT */
3069 @@ -1471,18 +1476,26 @@ username_completion_function (text, stat
3070     because of all the pathnames that must be followed when looking up the
3071     completion for a command. */
3072  char *
3073 -filename_completion_function (text, state)
3074 -     char *text;
3075 +rl_filename_completion_function (text, state)
3076 +     const char *text;
3077       int state;
3079 +#ifdef __MINGW32__
3080 +  static WIN32_FIND_DATA entry;
3081 +  static HANDLE directory = NULL;
3082 +  static BOOL found = 0;
3083 +  char tmp[MAX_PATH];
3084 +# define DIR void
3085 +#else
3086 +  struct dirent *entry;
3087    static DIR *directory = (DIR *)NULL;
3088 +#endif
3089    static char *filename = (char *)NULL;
3090    static char *dirname = (char *)NULL;
3091    static char *users_dirname = (char *)NULL;
3092    static int filename_len;
3093    char *temp;
3094    int dirlen;
3095 -  struct dirent *entry;
3097    /* If we don't have any state, then do some initialization. */
3098    if (state == 0)
3099 @@ -1542,13 +1555,27 @@ filename_completion_function (text, stat
3100           dirname = temp;
3101         }
3103 +      if (rl_directory_rewrite_hook)
3104 +       (*rl_directory_rewrite_hook) (&dirname);
3106        if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
3107         {
3108           free (users_dirname);
3109           users_dirname = savestring (dirname);
3110         }
3112 +#ifdef __MINGW32__
3113 +      strcpy (tmp, dirname);
3114 +      if (tmp[strlen (tmp) - 1] == '/')
3115 +       strcat (tmp, "*");
3116 +      else
3117 +       strcat (tmp, "/*");
3118 +       
3119 +      directory = FindFirstFile (tmp, &entry);
3120 +      found = 1;
3121 +#else  
3122        directory = opendir (dirname);
3123 +#endif
3124        filename_len = strlen (filename);
3126        rl_filename_completion_desired = 1;
3127 @@ -1561,17 +1588,20 @@ filename_completion_function (text, stat
3128    /* *** UNIMPLEMENTED *** */
3130    /* Now that we have some state, we can read the directory. */
3132 +#ifndef __MINGW32__
3133    entry = (struct dirent *)NULL;
3134    while (directory && (entry = readdir (directory)))
3135 +#else
3136 +  while (directory != INVALID_HANDLE_VALUE && directory && found)
3137 +#endif
3138      {
3139        /* Special case for no filename.
3140          All entries except "." and ".." match. */
3141        if (filename_len == 0)
3142         {
3143 -         if (entry->d_name[0] != '.' ||
3144 -              (entry->d_name[1] &&
3145 -                (entry->d_name[1] != '.' || entry->d_name[2])))
3146 +         if (FILENAME(entry)[0] != '.' ||
3147 +             (FILENAME(entry)[1] &&
3148 +              (FILENAME(entry)[1] != '.' || FILENAME(entry)[2])))
3149             break;
3150         }
3151        else
3152 @@ -1580,22 +1610,29 @@ filename_completion_function (text, stat
3153              it is a match. */
3154           if (_rl_completion_case_fold)
3155             {
3156 -             if ((_rl_to_lower (entry->d_name[0]) == _rl_to_lower (filename[0])) &&
3157 +             if ((_rl_to_lower (FILENAME(entry)[0]) == _rl_to_lower (filename[0])) &&
3158                   (((int)D_NAMLEN (entry)) >= filename_len) &&
3159 -                 (_rl_strnicmp (filename, entry->d_name, filename_len) == 0))
3160 +                 (_rl_strnicmp (filename, FILENAME(entry), filename_len) == 0))
3161                 break;
3162             }
3163           else
3164             {
3165 -             if ((entry->d_name[0] == filename[0]) &&
3166 +             if ((FILENAME(entry)[0] == filename[0]) &&
3167                   (((int)D_NAMLEN (entry)) >= filename_len) &&
3168 -                 (strncmp (filename, entry->d_name, filename_len) == 0))
3169 +                 (strncmp (filename, FILENAME(entry), filename_len) == 0))
3170                 break;
3171             }
3172         }
3173 +#ifdef __MINGW32__
3174 +      found = FindNextFile (directory, &entry);
3175 +#endif    
3176      }
3178 +#ifdef __MINGW32__
3179 +  if (!found)
3180 +#else
3181    if (entry == 0)
3182 +#endif
3183      {
3184        if (directory)
3185         {
3186 @@ -1641,15 +1678,21 @@ filename_completion_function (text, stat
3187           else
3188             {
3189               dirlen = strlen (users_dirname);
3190 -             temp = xmalloc (1 + dirlen + D_NAMLEN (entry));
3191 +             temp = xmalloc (2 + dirlen + D_NAMLEN (entry));
3192               strcpy (temp, users_dirname);
3193 +             /* Make sure that temp has a trailing slash here. */
3194 +             if (users_dirname[dirlen - 1] != '/')
3195 +               temp[dirlen++] = '/';
3196             }
3198 -         strcpy (temp + dirlen, entry->d_name);
3199 +         strcpy (temp + dirlen, FILENAME(entry));
3200         }
3201        else
3202 -       temp = savestring (entry->d_name);
3203 +       temp = savestring (FILENAME(entry));
3205 +#ifdef __MINGW32__
3206 +      found = FindNextFile (directory, &entry);
3207 +#endif
3208        return (temp);
3209      }
3211 @@ -1667,7 +1710,7 @@ int
3212  rl_menu_complete (count, ignore)
3213       int count, ignore;
3215 -  Function *our_func;
3216 +  rl_compentry_func_t *our_func;
3217    int matching_filenames, found_quote;
3219    static char *orig_text;
3220 @@ -1697,7 +1740,7 @@ rl_menu_complete (count, ignore)
3222        our_func = rl_completion_entry_function
3223                         ? rl_completion_entry_function
3224 -                       : (Function *)filename_completion_function;
3225 +                       : rl_filename_completion_function;
3227        /* We now look backwards for the start of a filename/variable word. */
3228        orig_end = rl_point;
3229 @@ -1716,19 +1759,14 @@ rl_menu_complete (count, ignore)
3230        matches = gen_completion_matches (orig_text, orig_start, orig_end,
3231                                         our_func, found_quote, quote_char);
3233 -#if 0
3234 -      /* If we are matching filenames, our_func will have been set to
3235 -        filename_completion_function */
3236 -      matching_filenames = our_func == (Function *)filename_completion_function;
3237 -#else
3238        /* If we are matching filenames, the attempted completion function will
3239          have set rl_filename_completion_desired to a non-zero value.  The basic
3240 -        filename_completion_function does this. */
3241 +        rl_filename_completion_function does this. */
3242        matching_filenames = rl_filename_completion_desired;
3243 -#endif
3245        if (matches == 0 || postprocess_matches (&matches, matching_filenames) == 0)
3246         {
3247 -         ding ();
3248 +         rl_ding ();
3249           FREE (matches);
3250           matches = (char **)0;
3251           FREE (orig_text);
3252 @@ -1749,7 +1787,7 @@ rl_menu_complete (count, ignore)
3254    if (matches == 0 || match_list_size == 0) 
3255      {
3256 -      ding ();
3257 +      rl_ding ();
3258        FREE (matches);
3259        matches = (char **)0;
3260        completion_changed_buffer = 0;
3261 @@ -1762,7 +1800,7 @@ rl_menu_complete (count, ignore)
3263    if (match_list_index == 0 && match_list_size > 1)
3264      {
3265 -      ding ();
3266 +      rl_ding ();
3267        insert_match (orig_text, orig_start, MULT_MATCH, &quote_char);
3268      }
3269    else
3270 Index: readline/config.h.in
3271 ===================================================================
3272 RCS file: /prjz/.cvsroot/gdb/readline/config.h.in,v
3273 retrieving revision 1.1.1.1
3274 diff -u -3 -p -r1.1.1.1 config.h.in
3275 --- readline/config.h.in        2003/02/16 21:36:29     1.1.1.1
3276 +++ readline/config.h.in        2001/02/07 18:31:08
3277 @@ -1,63 +1,20 @@
3278 -/* config.h.in.  Generated automatically from configure.in by autoheader.  */
3279 +/* config.h.in.  Maintained by hand. */
3281 -/* Define if you have the strcoll function and it is properly defined.  */
3282 -#undef HAVE_STRCOLL
3284  /* Define if on MINIX.  */
3285  #undef _MINIX
3287 -/* Define if the system does not provide POSIX.1 features except
3288 -   with this defined.  */
3289 -#undef _POSIX_1_SOURCE
3291 -/* Define if you need to in order for stat and other things to work.  */
3292 -#undef _POSIX_SOURCE
3294  /* Define as the return type of signal handlers (int or void).  */
3295  #undef RETSIGTYPE
3297  /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly.  */
3298  #undef STAT_MACROS_BROKEN
3300 -/* Definitions pulled in from aclocal.m4. */
3301  #undef VOID_SIGHANDLER
3303 -#undef GWINSZ_IN_SYS_IOCTL
3305 -#undef TIOCSTAT_IN_SYS_IOCTL
3307 -#undef HAVE_GETPW_DECLS
3309 -#undef FIONREAD_IN_SYS_IOCTL
3311 -#undef HAVE_BSD_SIGNALS
3313 -#undef HAVE_LSTAT
3315 -#undef HAVE_POSIX_SIGNALS
3317 -#undef HAVE_POSIX_SIGSETJMP
3319 -#undef HAVE_USG_SIGHOLD
3321 -#undef MUST_REINSTALL_SIGHANDLERS
3323 -#undef SPEED_T_IN_SYS_TYPES
3325 -#undef STRCOLL_BROKEN
3327 -#undef STRUCT_DIRENT_HAS_D_FILENO
3329 -#undef STRUCT_DIRENT_HAS_D_INO
3331 -#undef STRUCT_WINSIZE_IN_SYS_IOCTL
3333 -#undef STRUCT_WINSIZE_IN_TERMIOS
3335 -/* Define if you have the lstat function.  */
3336 +/* Define if you have the lstat function. */
3337  #undef HAVE_LSTAT
3339 -/* Define if you have the memmove function.  */
3340 +/* Define if you have the memmove function. */
3341  #undef HAVE_MEMMOVE
3343  /* Define if you have the putenv function.  */
3344 @@ -69,27 +26,26 @@
3345  /* Define if you have the setenv function.  */
3346  #undef HAVE_SETENV
3348 -/* Define if you have the setlocale function.  */
3349 -#undef HAVE_SETLOCALE
3351  /* Define if you have the strcasecmp function.  */
3352  #undef HAVE_STRCASECMP
3354 +/* Define if you have the setlocale function. */
3355 +#undef HAVE_SETLOCALE
3357  /* Define if you have the tcgetattr function.  */
3358  #undef HAVE_TCGETATTR
3360 +/* Define if you have the strcoll function.  */
3361 +#undef HAVE_STRCOLL
3363 +#undef STRCOLL_BROKEN
3365  /* Define if you have the <dirent.h> header file.  */
3366  #undef HAVE_DIRENT_H
3368 -/* Define if you have the <locale.h> header file.  */
3369 -#undef HAVE_LOCALE_H
3371  /* Define if you have the <ndir.h> header file.  */
3372  #undef HAVE_NDIR_H
3374 -/* Define if you have the <stdarg.h> header file.  */
3375 -#undef HAVE_STDARG_H
3377  /* Define if you have the <stdlib.h> header file.  */
3378  #undef HAVE_STDLIB_H
3380 @@ -131,7 +87,43 @@
3382  /* Define if you have the <varargs.h> header file.  */
3383  #undef HAVE_VARARGS_H
3384 -/* config.h.bot */
3386 +/* Define if you have the <stdarg.h> header file.  */
3387 +#undef HAVE_STDARG_H
3389 +#undef HAVE_LOCALE_H
3391 +/* Definitions pulled in from aclocal.m4. */
3392 +#undef VOID_SIGHANDLER
3394 +#undef GWINSZ_IN_SYS_IOCTL
3396 +#undef STRUCT_WINSIZE_IN_SYS_IOCTL
3398 +#undef STRUCT_WINSIZE_IN_TERMIOS
3400 +#undef TIOCSTAT_IN_SYS_IOCTL
3402 +#undef FIONREAD_IN_SYS_IOCTL
3404 +#undef SPEED_T_IN_SYS_TYPES
3406 +#undef HAVE_GETPW_DECLS
3408 +#undef STRUCT_DIRENT_HAS_D_INO
3410 +#undef STRUCT_DIRENT_HAS_D_FILENO
3412 +#undef HAVE_BSD_SIGNALS
3414 +#undef HAVE_POSIX_SIGNALS
3416 +#undef HAVE_USG_SIGHOLD
3418 +#undef MUST_REINSTALL_SIGHANDLERS
3420 +#undef HAVE_POSIX_SIGSETJMP
3422  /* modify settings or make new ones based on what autoconf tells us. */
3424  /* Ultrix botches type-ahead when switching from canonical to
3425 Index: readline/configure
3426 ===================================================================
3427 RCS file: /prjz/.cvsroot/gdb/readline/configure,v
3428 retrieving revision 1.1.1.1
3429 diff -u -3 -p -r1.1.1.1 configure
3430 --- readline/configure  2003/02/16 21:36:29     1.1.1.1
3431 +++ readline/configure  2001/04/02 19:56:02
3432 @@ -1,7 +1,7 @@
3433  #! /bin/sh
3435 -# From configure.in for Readline 4.1, version 2.22, from autoconf version 2.13
3436 -LIBVERSION=4.1
3437 +# From configure.in for Readline 4.2, version 2.26, from autoconf version 2.13
3438 +LIBVERSION=4.2
3442 @@ -103,6 +103,8 @@ LIBVERSION=4.1
3448  # Guess values for system-dependent variables and create Makefiles.
3449  # Generated automatically using autoconf version 2.13 
3450  # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
3451 @@ -630,9 +632,8 @@ fi
3456  ac_aux_dir=
3457 -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
3458 +for ac_dir in ./support $srcdir/./support; do
3459    if test -f $ac_dir/install-sh; then
3460      ac_aux_dir=$ac_dir
3461      ac_install_sh="$ac_aux_dir/install-sh -c"
3462 @@ -644,20 +645,21 @@ for ac_dir in $srcdir $srcdir/.. $srcdir
3463    fi
3464  done
3465  if test -z "$ac_aux_dir"; then
3466 -  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
3467 +  { echo "configure: error: can not find install-sh or install.sh in ./support $srcdir/./support" 1>&2; exit 1; }
3468  fi
3469  ac_config_guess=$ac_aux_dir/config.guess
3470  ac_config_sub=$ac_aux_dir/config.sub
3471  ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
3475  # Make sure we can run config.sub.
3476  if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
3477  else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
3478  fi
3480  echo $ac_n "checking host system type""... $ac_c" 1>&6
3481 -echo "configure:661: checking host system type" >&5
3482 +echo "configure:663: checking host system type" >&5
3484  host_alias=$host
3485  case "$host_alias" in
3486 @@ -695,10 +697,37 @@ fi
3487  # We want these before the checks, so the checks can modify their values.
3488  test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
3490 +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
3491 +echo "configure:702: checking whether ${MAKE-make} sets \${MAKE}" >&5
3492 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
3493 +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
3494 +  echo $ac_n "(cached) $ac_c" 1>&6
3495 +else
3496 +  cat > conftestmake <<\EOF
3497 +all:
3498 +       @echo 'ac_maketemp="${MAKE}"'
3499 +EOF
3500 +# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
3501 +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
3502 +if test -n "$ac_maketemp"; then
3503 +  eval ac_cv_prog_make_${ac_make}_set=yes
3504 +else
3505 +  eval ac_cv_prog_make_${ac_make}_set=no
3507 +rm -f conftestmake
3509 +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
3510 +  echo "$ac_t""yes" 1>&6
3511 +  SET_MAKE=
3512 +else
3513 +  echo "$ac_t""no" 1>&6
3514 +  SET_MAKE="MAKE=${MAKE-make}"
3517  # Extract the first word of "gcc", so it can be a program name with args.
3518  set dummy gcc; ac_word=$2
3519  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3520 -echo "configure:702: checking for $ac_word" >&5
3521 +echo "configure:731: checking for $ac_word" >&5
3522  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
3523    echo $ac_n "(cached) $ac_c" 1>&6
3524  else
3525 @@ -728,7 +757,7 @@ if test -z "$CC"; then
3526    # Extract the first word of "cc", so it can be a program name with args.
3527  set dummy cc; ac_word=$2
3528  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3529 -echo "configure:732: checking for $ac_word" >&5
3530 +echo "configure:761: checking for $ac_word" >&5
3531  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
3532    echo $ac_n "(cached) $ac_c" 1>&6
3533  else
3534 @@ -779,7 +808,7 @@ fi
3535        # Extract the first word of "cl", so it can be a program name with args.
3536  set dummy cl; ac_word=$2
3537  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3538 -echo "configure:783: checking for $ac_word" >&5
3539 +echo "configure:812: checking for $ac_word" >&5
3540  if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
3541    echo $ac_n "(cached) $ac_c" 1>&6
3542  else
3543 @@ -811,7 +840,7 @@ fi
3544  fi
3546  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
3547 -echo "configure:815: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
3548 +echo "configure:844: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
3550  ac_ext=c
3551  # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
3552 @@ -822,12 +851,12 @@ cross_compiling=$ac_cv_prog_cc_cross
3554  cat > conftest.$ac_ext << EOF
3556 -#line 826 "configure"
3557 +#line 855 "configure"
3558  #include "confdefs.h"
3560  main(){return(0);}
3561  EOF
3562 -if { (eval echo configure:831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3563 +if { (eval echo configure:860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3564    ac_cv_prog_cc_works=yes
3565    # If we can't run a trivial program, we are probably using a cross compiler.
3566    if (./conftest; exit) 2>/dev/null; then
3567 @@ -853,12 +882,12 @@ if test $ac_cv_prog_cc_works = no; then
3568    { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
3569  fi
3570  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
3571 -echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
3572 +echo "configure:886: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
3573  echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
3574  cross_compiling=$ac_cv_prog_cc_cross
3576  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
3577 -echo "configure:862: checking whether we are using GNU C" >&5
3578 +echo "configure:891: checking whether we are using GNU C" >&5
3579  if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
3580    echo $ac_n "(cached) $ac_c" 1>&6
3581  else
3582 @@ -867,7 +896,7 @@ else
3583    yes;
3584  #endif
3585  EOF
3586 -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3587 +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:900: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
3588    ac_cv_prog_gcc=yes
3589  else
3590    ac_cv_prog_gcc=no
3591 @@ -886,7 +915,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
3592  ac_save_CFLAGS="$CFLAGS"
3593  CFLAGS=
3594  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
3595 -echo "configure:890: checking whether ${CC-cc} accepts -g" >&5
3596 +echo "configure:919: checking whether ${CC-cc} accepts -g" >&5
3597  if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
3598    echo $ac_n "(cached) $ac_c" 1>&6
3599  else
3600 @@ -918,7 +947,7 @@ else
3601  fi
3603  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3604 -echo "configure:922: checking how to run the C preprocessor" >&5
3605 +echo "configure:951: checking how to run the C preprocessor" >&5
3606  # On Suns, sometimes $CPP names a directory.
3607  if test -n "$CPP" && test -d "$CPP"; then
3608    CPP=
3609 @@ -933,13 +962,13 @@ else
3610    # On the NeXT, cc -E runs the code through the compiler's parser,
3611    # not just through cpp.
3612    cat > conftest.$ac_ext <<EOF
3613 -#line 937 "configure"
3614 +#line 966 "configure"
3615  #include "confdefs.h"
3616  #include <assert.h>
3617  Syntax Error
3618  EOF
3619  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3620 -{ (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3621 +{ (eval echo configure:972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3622  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3623  if test -z "$ac_err"; then
3624    :
3625 @@ -950,13 +979,13 @@ else
3626    rm -rf conftest*
3627    CPP="${CC-cc} -E -traditional-cpp"
3628    cat > conftest.$ac_ext <<EOF
3629 -#line 954 "configure"
3630 +#line 983 "configure"
3631  #include "confdefs.h"
3632  #include <assert.h>
3633  Syntax Error
3634  EOF
3635  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3636 -{ (eval echo configure:960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3637 +{ (eval echo configure:989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3638  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3639  if test -z "$ac_err"; then
3640    :
3641 @@ -967,13 +996,13 @@ else
3642    rm -rf conftest*
3643    CPP="${CC-cc} -nologo -E"
3644    cat > conftest.$ac_ext <<EOF
3645 -#line 971 "configure"
3646 +#line 1000 "configure"
3647  #include "confdefs.h"
3648  #include <assert.h>
3649  Syntax Error
3650  EOF
3651  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3652 -{ (eval echo configure:977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3653 +{ (eval echo configure:1006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3654  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3655  if test -z "$ac_err"; then
3656    :
3657 @@ -999,17 +1028,17 @@ echo "$ac_t""$CPP" 1>&6
3659  ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3660  echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3661 -echo "configure:1003: checking for minix/config.h" >&5
3662 +echo "configure:1032: checking for minix/config.h" >&5
3663  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3664    echo $ac_n "(cached) $ac_c" 1>&6
3665  else
3666    cat > conftest.$ac_ext <<EOF
3667 -#line 1008 "configure"
3668 +#line 1037 "configure"
3669  #include "confdefs.h"
3670  #include <minix/config.h>
3671  EOF
3672  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3673 -{ (eval echo configure:1013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3674 +{ (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3675  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3676  if test -z "$ac_err"; then
3677    rm -rf conftest*
3678 @@ -1047,52 +1076,18 @@ EOF
3679  fi
3683 -if test "x$cross_compiling" = "xyes"; then
3684 -    case "${host}" in
3685 -    *-cygwin*)
3686 -       cross_cache=${srcdir}/cross-build/cygwin.cache
3687 -       if test -r "${cross_cache}"; then
3688 -           echo "loading cross-build cache file ${cross_cache}"
3689 -           . ${cross_cache}
3690 -       fi
3691 -       LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
3692 -       unset cross_cache
3693 -       ;;
3694 -    *)  echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
3695 -       ;;
3696 -    esac
3699 -if test "x$cross_compiling" = "xyes"; then
3700 -  CROSS_COMPILING_FLAG=-DCROSS_COMPILING
3701 -else
3702 -  CROSS_COMPILING_FLAG=
3706 -if test -z "$CC_FOR_BUILD"; then
3707 -    if test "x$cross_compiling" = "xno"; then
3708 -        CC_FOR_BUILD='$(CC)'
3709 -    else
3710 -        CC_FOR_BUILD=gcc
3711 -    fi
3716  # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
3717  test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
3719  if test $ac_cv_prog_gcc = yes; then
3720      echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
3721 -echo "configure:1090: checking whether ${CC-cc} needs -traditional" >&5
3722 +echo "configure:1085: checking whether ${CC-cc} needs -traditional" >&5
3723  if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
3724    echo $ac_n "(cached) $ac_c" 1>&6
3725  else
3726      ac_pattern="Autoconf.*'x'"
3727    cat > conftest.$ac_ext <<EOF
3728 -#line 1096 "configure"
3729 +#line 1091 "configure"
3730  #include "confdefs.h"
3731  #include <sgtty.h>
3732  Autoconf TIOCGETP
3733 @@ -1110,7 +1105,7 @@ rm -f conftest*
3735    if test $ac_cv_prog_gcc_traditional = no; then
3736      cat > conftest.$ac_ext <<EOF
3737 -#line 1114 "configure"
3738 +#line 1109 "configure"
3739  #include "confdefs.h"
3740  #include <termio.h>
3741  Autoconf TCGETA
3742 @@ -1143,7 +1138,7 @@ fi
3743  # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
3744  # ./install, which can be erroneously created by make from ./install.sh.
3745  echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
3746 -echo "configure:1147: checking for a BSD compatible install" >&5
3747 +echo "configure:1142: checking for a BSD compatible install" >&5
3748  if test -z "$INSTALL"; then
3749  if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
3750    echo $ac_n "(cached) $ac_c" 1>&6
3751 @@ -1198,7 +1193,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA=
3752  # Extract the first word of "ar", so it can be a program name with args.
3753  set dummy ar; ac_word=$2
3754  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3755 -echo "configure:1202: checking for $ac_word" >&5
3756 +echo "configure:1197: checking for $ac_word" >&5
3757  if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
3758    echo $ac_n "(cached) $ac_c" 1>&6
3759  else
3760 @@ -1228,7 +1223,7 @@ test -n "$ARFLAGS" || ARFLAGS="cr"
3761  # Extract the first word of "ranlib", so it can be a program name with args.
3762  set dummy ranlib; ac_word=$2
3763  echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3764 -echo "configure:1232: checking for $ac_word" >&5
3765 +echo "configure:1227: checking for $ac_word" >&5
3766  if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
3767    echo $ac_n "(cached) $ac_c" 1>&6
3768  else
3769 @@ -1260,12 +1255,12 @@ MAKE_SHELL=/bin/sh
3772  echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3773 -echo "configure:1264: checking return type of signal handlers" >&5
3774 +echo "configure:1259: checking return type of signal handlers" >&5
3775  if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3776    echo $ac_n "(cached) $ac_c" 1>&6
3777  else
3778    cat > conftest.$ac_ext <<EOF
3779 -#line 1269 "configure"
3780 +#line 1264 "configure"
3781  #include "confdefs.h"
3782  #include <sys/types.h>
3783  #include <signal.h>
3784 @@ -1282,7 +1277,7 @@ int main() {
3785  int i;
3786  ; return 0; }
3787  EOF
3788 -if { (eval echo configure:1286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3789 +if { (eval echo configure:1281: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3790    rm -rf conftest*
3791    ac_cv_type_signal=void
3792  else
3793 @@ -1302,12 +1297,12 @@ EOF
3796  echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
3797 -echo "configure:1306: checking whether stat file-mode macros are broken" >&5
3798 +echo "configure:1301: checking whether stat file-mode macros are broken" >&5
3799  if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
3800    echo $ac_n "(cached) $ac_c" 1>&6
3801  else
3802    cat > conftest.$ac_ext <<EOF
3803 -#line 1311 "configure"
3804 +#line 1306 "configure"
3805  #include "confdefs.h"
3806  #include <sys/types.h>
3807  #include <sys/stat.h>
3808 @@ -1362,12 +1357,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/di
3809  do
3810  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3811  echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
3812 -echo "configure:1366: checking for $ac_hdr that defines DIR" >&5
3813 +echo "configure:1361: checking for $ac_hdr that defines DIR" >&5
3814  if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
3815    echo $ac_n "(cached) $ac_c" 1>&6
3816  else
3817    cat > conftest.$ac_ext <<EOF
3818 -#line 1371 "configure"
3819 +#line 1366 "configure"
3820  #include "confdefs.h"
3821  #include <sys/types.h>
3822  #include <$ac_hdr>
3823 @@ -1375,7 +1370,7 @@ int main() {
3824  DIR *dirp = 0;
3825  ; return 0; }
3826  EOF
3827 -if { (eval echo configure:1379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3828 +if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3829    rm -rf conftest*
3830    eval "ac_cv_header_dirent_$ac_safe=yes"
3831  else
3832 @@ -1400,7 +1395,7 @@ done
3833  # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
3834  if test $ac_header_dirent = dirent.h; then
3835  echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
3836 -echo "configure:1404: checking for opendir in -ldir" >&5
3837 +echo "configure:1399: checking for opendir in -ldir" >&5
3838  ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
3839  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3840    echo $ac_n "(cached) $ac_c" 1>&6
3841 @@ -1408,7 +1403,7 @@ else
3842    ac_save_LIBS="$LIBS"
3843  LIBS="-ldir  $LIBS"
3844  cat > conftest.$ac_ext <<EOF
3845 -#line 1412 "configure"
3846 +#line 1407 "configure"
3847  #include "confdefs.h"
3848  /* Override any gcc2 internal prototype to avoid an error.  */
3849  /* We use char because int might match the return type of a gcc2
3850 @@ -1419,7 +1414,7 @@ int main() {
3851  opendir()
3852  ; return 0; }
3853  EOF
3854 -if { (eval echo configure:1423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3855 +if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3856    rm -rf conftest*
3857    eval "ac_cv_lib_$ac_lib_var=yes"
3858  else
3859 @@ -1441,7 +1436,7 @@ fi
3861  else
3862  echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
3863 -echo "configure:1445: checking for opendir in -lx" >&5
3864 +echo "configure:1440: checking for opendir in -lx" >&5
3865  ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
3866  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3867    echo $ac_n "(cached) $ac_c" 1>&6
3868 @@ -1449,7 +1444,7 @@ else
3869    ac_save_LIBS="$LIBS"
3870  LIBS="-lx  $LIBS"
3871  cat > conftest.$ac_ext <<EOF
3872 -#line 1453 "configure"
3873 +#line 1448 "configure"
3874  #include "confdefs.h"
3875  /* Override any gcc2 internal prototype to avoid an error.  */
3876  /* We use char because int might match the return type of a gcc2
3877 @@ -1460,7 +1455,7 @@ int main() {
3878  opendir()
3879  ; return 0; }
3880  EOF
3881 -if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3882 +if { (eval echo configure:1459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3883    rm -rf conftest*
3884    eval "ac_cv_lib_$ac_lib_var=yes"
3885  else
3886 @@ -1487,12 +1482,12 @@ for ac_func in lstat memmove putenv sele
3887                 strcasecmp tcgetattr
3888  do
3889  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3890 -echo "configure:1491: checking for $ac_func" >&5
3891 +echo "configure:1486: checking for $ac_func" >&5
3892  if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3893    echo $ac_n "(cached) $ac_c" 1>&6
3894  else
3895    cat > conftest.$ac_ext <<EOF
3896 -#line 1496 "configure"
3897 +#line 1491 "configure"
3898  #include "confdefs.h"
3899  /* System header to define __stub macros and hopefully few prototypes,
3900      which can conflict with char $ac_func(); below.  */
3901 @@ -1515,7 +1510,7 @@ $ac_func();
3903  ; return 0; }
3904  EOF
3905 -if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3906 +if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3907    rm -rf conftest*
3908    eval "ac_cv_func_$ac_func=yes"
3909  else
3910 @@ -1541,7 +1536,7 @@ done
3913  echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
3914 -echo "configure:1545: checking for working strcoll" >&5
3915 +echo "configure:1540: checking for working strcoll" >&5
3916  if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
3917    echo $ac_n "(cached) $ac_c" 1>&6
3918  else
3919 @@ -1549,7 +1544,7 @@ else
3920    ac_cv_func_strcoll_works=no
3921  else
3922    cat > conftest.$ac_ext <<EOF
3923 -#line 1553 "configure"
3924 +#line 1548 "configure"
3925  #include "confdefs.h"
3926  #include <string.h>
3927  main ()
3928 @@ -1559,7 +1554,7 @@ main ()
3929         strcoll ("123", "456") >= 0);
3931  EOF
3932 -if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3933 +if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
3934  then
3935    ac_cv_func_strcoll_works=yes
3936  else
3937 @@ -1588,17 +1583,17 @@ for ac_hdr in unistd.h stdlib.h varargs.
3938  do
3939  ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3940  echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3941 -echo "configure:1592: checking for $ac_hdr" >&5
3942 +echo "configure:1587: checking for $ac_hdr" >&5
3943  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3944    echo $ac_n "(cached) $ac_c" 1>&6
3945  else
3946    cat > conftest.$ac_ext <<EOF
3947 -#line 1597 "configure"
3948 +#line 1592 "configure"
3949  #include "confdefs.h"
3950  #include <$ac_hdr>
3951  EOF
3952  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3953 -{ (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3954 +{ (eval echo configure:1597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3955  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3956  if test -z "$ac_err"; then
3957    rm -rf conftest*
3958 @@ -1627,13 +1622,13 @@ done
3961  echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
3962 -echo "configure:1631: checking for type of signal functions" >&5
3963 +echo "configure:1626: checking for type of signal functions" >&5
3964  if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then
3965    echo $ac_n "(cached) $ac_c" 1>&6
3966  else
3967    
3968    cat > conftest.$ac_ext <<EOF
3969 -#line 1637 "configure"
3970 +#line 1632 "configure"
3971  #include "confdefs.h"
3972  #include <signal.h>
3973  int main() {
3974 @@ -1646,7 +1641,7 @@ int main() {
3975    
3976  ; return 0; }
3977  EOF
3978 -if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3979 +if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3980    rm -rf conftest*
3981    bash_cv_signal_vintage=posix
3982  else
3983 @@ -1655,7 +1650,7 @@ else
3984    rm -rf conftest*
3985    
3986      cat > conftest.$ac_ext <<EOF
3987 -#line 1659 "configure"
3988 +#line 1654 "configure"
3989  #include "confdefs.h"
3990  #include <signal.h>
3991  int main() {
3992 @@ -1665,7 +1660,7 @@ int main() {
3993      
3994  ; return 0; }
3995  EOF
3996 -if { (eval echo configure:1669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3997 +if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3998    rm -rf conftest*
3999    bash_cv_signal_vintage=4.2bsd
4000  else
4001 @@ -1674,7 +1669,7 @@ else
4002    rm -rf conftest*
4003    
4004        cat > conftest.$ac_ext <<EOF
4005 -#line 1678 "configure"
4006 +#line 1673 "configure"
4007  #include "confdefs.h"
4009         #include <signal.h>
4010 @@ -1687,7 +1682,7 @@ int main() {
4011          
4012  ; return 0; }
4013  EOF
4014 -if { (eval echo configure:1691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4015 +if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4016    rm -rf conftest*
4017    bash_cv_signal_vintage=svr3
4018  else
4019 @@ -1728,7 +1723,7 @@ fi
4022  echo $ac_n "checking if signal handlers must be reinstalled when invoked""... $ac_c" 1>&6
4023 -echo "configure:1732: checking if signal handlers must be reinstalled when invoked" >&5
4024 +echo "configure:1727: checking if signal handlers must be reinstalled when invoked" >&5
4025  if eval "test \"`echo '$''{'bash_cv_must_reinstall_sighandlers'+set}'`\" = set"; then
4026    echo $ac_n "(cached) $ac_c" 1>&6
4027  else
4028 @@ -1738,7 +1733,7 @@ else
4030  else
4031    cat > conftest.$ac_ext <<EOF
4032 -#line 1742 "configure"
4033 +#line 1737 "configure"
4034  #include "confdefs.h"
4036  #include <signal.h>
4037 @@ -1785,7 +1780,7 @@ main()
4040  EOF
4041 -if { (eval echo configure:1789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4042 +if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4043  then
4044    bash_cv_must_reinstall_sighandlers=no
4045  else
4046 @@ -1810,7 +1805,7 @@ fi
4049  echo $ac_n "checking for presence of POSIX-style sigsetjmp/siglongjmp""... $ac_c" 1>&6
4050 -echo "configure:1814: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
4051 +echo "configure:1809: checking for presence of POSIX-style sigsetjmp/siglongjmp" >&5
4052  if eval "test \"`echo '$''{'bash_cv_func_sigsetjmp'+set}'`\" = set"; then
4053    echo $ac_n "(cached) $ac_c" 1>&6
4054  else
4055 @@ -1820,7 +1815,7 @@ else
4057  else
4058    cat > conftest.$ac_ext <<EOF
4059 -#line 1824 "configure"
4060 +#line 1819 "configure"
4061  #include "confdefs.h"
4063  #ifdef HAVE_UNISTD_H
4064 @@ -1861,7 +1856,7 @@ exit(1);
4065  #endif
4067  EOF
4068 -if { (eval echo configure:1865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4069 +if { (eval echo configure:1860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4070  then
4071    bash_cv_func_sigsetjmp=present
4072  else
4073 @@ -1884,12 +1879,12 @@ EOF
4074  fi
4076  echo $ac_n "checking for lstat""... $ac_c" 1>&6
4077 -echo "configure:1888: checking for lstat" >&5
4078 +echo "configure:1883: checking for lstat" >&5
4079  if eval "test \"`echo '$''{'bash_cv_func_lstat'+set}'`\" = set"; then
4080    echo $ac_n "(cached) $ac_c" 1>&6
4081  else
4082    cat > conftest.$ac_ext <<EOF
4083 -#line 1893 "configure"
4084 +#line 1888 "configure"
4085  #include "confdefs.h"
4087  #include <sys/types.h>
4088 @@ -1899,7 +1894,7 @@ int main() {
4089   lstat(".",(struct stat *)0); 
4090  ; return 0; }
4091  EOF
4092 -if { (eval echo configure:1903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4093 +if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4094    rm -rf conftest*
4095    bash_cv_func_lstat=yes
4096  else
4097 @@ -1919,37 +1914,36 @@ EOF
4099  fi
4101 -echo $ac_n "checking whether programs are able to redeclare getpw functions""... $ac_c" 1>&6
4102 -echo "configure:1924: checking whether programs are able to redeclare getpw functions" >&5
4103 -if eval "test \"`echo '$''{'bash_cv_can_redecl_getpw'+set}'`\" = set"; then
4104 +echo $ac_n "checking whether getpw functions are declared in pwd.h""... $ac_c" 1>&6
4105 +echo "configure:1919: checking whether getpw functions are declared in pwd.h" >&5
4106 +if eval "test \"`echo '$''{'bash_cv_getpw_declared'+set}'`\" = set"; then
4107    echo $ac_n "(cached) $ac_c" 1>&6
4108  else
4109    cat > conftest.$ac_ext <<EOF
4110 -#line 1929 "configure"
4111 +#line 1924 "configure"
4112  #include "confdefs.h"
4114  #include <sys/types.h>
4115 +#ifdef HAVE_UNISTD_H
4116 +#  include <unistd.h>
4117 +#endif
4118  #include <pwd.h>
4119 -extern struct passwd *getpwent();
4120 -extern struct passwd *getpwuid();
4121 -extern struct passwd *getpwnam();
4122 -int main() {
4123 -struct passwd *z; z = getpwent(); z = getpwuid(0); z = getpwnam("root");
4124 -; return 0; }
4126  EOF
4127 -if { (eval echo configure:1940: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4128 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4129 +  egrep "getpwuid" >/dev/null 2>&1; then
4130    rm -rf conftest*
4131 -  bash_cv_can_redecl_getpw=yes
4132 +  bash_cv_getpw_declared=yes
4133  else
4134 -  echo "configure: failed program was:" >&5
4135 -  cat conftest.$ac_ext >&5
4136    rm -rf conftest*
4137 -  bash_cv_can_redecl_getpw=no
4138 +  bash_cv_getpw_declared=no
4139  fi
4140  rm -f conftest*
4142  fi
4144 -echo "$ac_t""$bash_cv_can_redecl_getpw" 1>&6
4145 -if test $bash_cv_can_redecl_getpw = no; then
4146 +echo "$ac_t""$bash_cv_getpw_declared" 1>&6
4147 +if test $bash_cv_getpw_declared = yes; then
4148  cat >> confdefs.h <<\EOF
4149  #define HAVE_GETPW_DECLS 1
4150  EOF
4151 @@ -1958,7 +1952,7 @@ fi
4154  echo $ac_n "checking whether or not strcoll and strcmp differ""... $ac_c" 1>&6
4155 -echo "configure:1962: checking whether or not strcoll and strcmp differ" >&5
4156 +echo "configure:1956: checking whether or not strcoll and strcmp differ" >&5
4157  if eval "test \"`echo '$''{'bash_cv_func_strcoll_broken'+set}'`\" = set"; then
4158    echo $ac_n "(cached) $ac_c" 1>&6
4159  else
4160 @@ -1968,7 +1962,7 @@ else
4162  else
4163    cat > conftest.$ac_ext <<EOF
4164 -#line 1972 "configure"
4165 +#line 1966 "configure"
4166  #include "confdefs.h"
4168  #include <stdio.h>
4169 @@ -2007,7 +2001,7 @@ char    *v[];
4172  EOF
4173 -if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4174 +if { (eval echo configure:2005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4175  then
4176    bash_cv_func_strcoll_broken=yes
4177  else
4178 @@ -2031,12 +2025,12 @@ fi
4181  echo $ac_n "checking whether signal handlers are of type void""... $ac_c" 1>&6
4182 -echo "configure:2035: checking whether signal handlers are of type void" >&5
4183 +echo "configure:2029: checking whether signal handlers are of type void" >&5
4184  if eval "test \"`echo '$''{'bash_cv_void_sighandler'+set}'`\" = set"; then
4185    echo $ac_n "(cached) $ac_c" 1>&6
4186  else
4187    cat > conftest.$ac_ext <<EOF
4188 -#line 2040 "configure"
4189 +#line 2034 "configure"
4190  #include "confdefs.h"
4191  #include <sys/types.h>
4192  #include <signal.h>
4193 @@ -2051,7 +2045,7 @@ int main() {
4194  int i;
4195  ; return 0; }
4196  EOF
4197 -if { (eval echo configure:2055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4198 +if { (eval echo configure:2049: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4199    rm -rf conftest*
4200    bash_cv_void_sighandler=yes
4201  else
4202 @@ -2071,12 +2065,12 @@ EOF
4203  fi
4205  echo $ac_n "checking for TIOCGWINSZ in sys/ioctl.h""... $ac_c" 1>&6
4206 -echo "configure:2075: checking for TIOCGWINSZ in sys/ioctl.h" >&5
4207 +echo "configure:2069: checking for TIOCGWINSZ in sys/ioctl.h" >&5
4208  if eval "test \"`echo '$''{'bash_cv_tiocgwinsz_in_ioctl'+set}'`\" = set"; then
4209    echo $ac_n "(cached) $ac_c" 1>&6
4210  else
4211    cat > conftest.$ac_ext <<EOF
4212 -#line 2080 "configure"
4213 +#line 2074 "configure"
4214  #include "confdefs.h"
4215  #include <sys/types.h>
4216  #include <sys/ioctl.h>
4217 @@ -2084,7 +2078,7 @@ int main() {
4218  int x = TIOCGWINSZ;
4219  ; return 0; }
4220  EOF
4221 -if { (eval echo configure:2088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4222 +if { (eval echo configure:2082: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4223    rm -rf conftest*
4224    bash_cv_tiocgwinsz_in_ioctl=yes
4225  else
4226 @@ -2105,12 +2099,12 @@ EOF
4227  fi
4229  echo $ac_n "checking for TIOCSTAT in sys/ioctl.h""... $ac_c" 1>&6
4230 -echo "configure:2109: checking for TIOCSTAT in sys/ioctl.h" >&5
4231 +echo "configure:2103: checking for TIOCSTAT in sys/ioctl.h" >&5
4232  if eval "test \"`echo '$''{'bash_cv_tiocstat_in_ioctl'+set}'`\" = set"; then
4233    echo $ac_n "(cached) $ac_c" 1>&6
4234  else
4235    cat > conftest.$ac_ext <<EOF
4236 -#line 2114 "configure"
4237 +#line 2108 "configure"
4238  #include "confdefs.h"
4239  #include <sys/types.h>
4240  #include <sys/ioctl.h>
4241 @@ -2118,7 +2112,7 @@ int main() {
4242  int x = TIOCSTAT;
4243  ; return 0; }
4244  EOF
4245 -if { (eval echo configure:2122: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4246 +if { (eval echo configure:2116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4247    rm -rf conftest*
4248    bash_cv_tiocstat_in_ioctl=yes
4249  else
4250 @@ -2139,12 +2133,12 @@ EOF
4251  fi
4253  echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&6
4254 -echo "configure:2143: checking for FIONREAD in sys/ioctl.h" >&5
4255 +echo "configure:2137: checking for FIONREAD in sys/ioctl.h" >&5
4256  if eval "test \"`echo '$''{'bash_cv_fionread_in_ioctl'+set}'`\" = set"; then
4257    echo $ac_n "(cached) $ac_c" 1>&6
4258  else
4259    cat > conftest.$ac_ext <<EOF
4260 -#line 2148 "configure"
4261 +#line 2142 "configure"
4262  #include "confdefs.h"
4263  #include <sys/types.h>
4264  #include <sys/ioctl.h>
4265 @@ -2152,7 +2146,7 @@ int main() {
4266  int x = FIONREAD;
4267  ; return 0; }
4268  EOF
4269 -if { (eval echo configure:2156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4270 +if { (eval echo configure:2150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4271    rm -rf conftest*
4272    bash_cv_fionread_in_ioctl=yes
4273  else
4274 @@ -2173,19 +2167,19 @@ EOF
4275  fi
4277  echo $ac_n "checking for speed_t in sys/types.h""... $ac_c" 1>&6
4278 -echo "configure:2177: checking for speed_t in sys/types.h" >&5
4279 +echo "configure:2171: checking for speed_t in sys/types.h" >&5
4280  if eval "test \"`echo '$''{'bash_cv_speed_t_in_sys_types'+set}'`\" = set"; then
4281    echo $ac_n "(cached) $ac_c" 1>&6
4282  else
4283    cat > conftest.$ac_ext <<EOF
4284 -#line 2182 "configure"
4285 +#line 2176 "configure"
4286  #include "confdefs.h"
4287  #include <sys/types.h>
4288  int main() {
4289  speed_t x;
4290  ; return 0; }
4291  EOF
4292 -if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4293 +if { (eval echo configure:2183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4294    rm -rf conftest*
4295    bash_cv_speed_t_in_sys_types=yes
4296  else
4297 @@ -2206,12 +2200,12 @@ EOF
4298  fi
4300  echo $ac_n "checking for struct winsize in sys/ioctl.h and termios.h""... $ac_c" 1>&6
4301 -echo "configure:2210: checking for struct winsize in sys/ioctl.h and termios.h" >&5
4302 +echo "configure:2204: checking for struct winsize in sys/ioctl.h and termios.h" >&5
4303  if eval "test \"`echo '$''{'bash_cv_struct_winsize_header'+set}'`\" = set"; then
4304    echo $ac_n "(cached) $ac_c" 1>&6
4305  else
4306    cat > conftest.$ac_ext <<EOF
4307 -#line 2215 "configure"
4308 +#line 2209 "configure"
4309  #include "confdefs.h"
4310  #include <sys/types.h>
4311  #include <sys/ioctl.h>
4312 @@ -2219,7 +2213,7 @@ int main() {
4313  struct winsize x;
4314  ; return 0; }
4315  EOF
4316 -if { (eval echo configure:2223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4317 +if { (eval echo configure:2217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4318    rm -rf conftest*
4319    bash_cv_struct_winsize_header=ioctl_h
4320  else
4321 @@ -2227,7 +2221,7 @@ else
4322    cat conftest.$ac_ext >&5
4323    rm -rf conftest*
4324    cat > conftest.$ac_ext <<EOF
4325 -#line 2231 "configure"
4326 +#line 2225 "configure"
4327  #include "confdefs.h"
4328  #include <sys/types.h>
4329  #include <termios.h>
4330 @@ -2235,7 +2229,7 @@ int main() {
4331  struct winsize x;
4332  ; return 0; }
4333  EOF
4334 -if { (eval echo configure:2239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4335 +if { (eval echo configure:2233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4336    rm -rf conftest*
4337    bash_cv_struct_winsize_header=termios_h
4338  else
4339 @@ -2268,12 +2262,12 @@ fi
4342  echo $ac_n "checking if struct dirent has a d_ino member""... $ac_c" 1>&6
4343 -echo "configure:2272: checking if struct dirent has a d_ino member" >&5
4344 +echo "configure:2266: checking if struct dirent has a d_ino member" >&5
4345  if eval "test \"`echo '$''{'bash_cv_dirent_has_dino'+set}'`\" = set"; then
4346    echo $ac_n "(cached) $ac_c" 1>&6
4347  else
4348    cat > conftest.$ac_ext <<EOF
4349 -#line 2277 "configure"
4350 +#line 2271 "configure"
4351  #include "confdefs.h"
4353  #include <stdio.h>
4354 @@ -2302,7 +2296,7 @@ struct dirent d; int z; z = d.d_ino;
4356  ; return 0; }
4357  EOF
4358 -if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4359 +if { (eval echo configure:2300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4360    rm -rf conftest*
4361    bash_cv_dirent_has_dino=yes
4362  else
4363 @@ -2324,12 +2318,12 @@ fi
4366  echo $ac_n "checking if struct dirent has a d_fileno member""... $ac_c" 1>&6
4367 -echo "configure:2328: checking if struct dirent has a d_fileno member" >&5
4368 +echo "configure:2322: checking if struct dirent has a d_fileno member" >&5
4369  if eval "test \"`echo '$''{'bash_cv_dirent_has_d_fileno'+set}'`\" = set"; then
4370    echo $ac_n "(cached) $ac_c" 1>&6
4371  else
4372    cat > conftest.$ac_ext <<EOF
4373 -#line 2333 "configure"
4374 +#line 2327 "configure"
4375  #include "confdefs.h"
4377  #include <stdio.h>
4378 @@ -2358,7 +2352,7 @@ struct dirent d; int z; z = d.d_fileno;
4380  ; return 0; }
4381  EOF
4382 -if { (eval echo configure:2362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4383 +if { (eval echo configure:2356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4384    rm -rf conftest*
4385    bash_cv_dirent_has_d_fileno=yes
4386  else
4387 @@ -2387,14 +2381,14 @@ if test "X$bash_cv_termcap_lib" = "X"; t
4388  _bash_needmsg=yes
4389  else
4390  echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
4391 -echo "configure:2391: checking which library has the termcap functions" >&5
4392 +echo "configure:2385: checking which library has the termcap functions" >&5
4393  _bash_needmsg=
4394  fi
4395  if eval "test \"`echo '$''{'bash_cv_termcap_lib'+set}'`\" = set"; then
4396    echo $ac_n "(cached) $ac_c" 1>&6
4397  else
4398    echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
4399 -echo "configure:2398: checking for tgetent in -ltermcap" >&5
4400 +echo "configure:2392: checking for tgetent in -ltermcap" >&5
4401  ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
4402  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4403    echo $ac_n "(cached) $ac_c" 1>&6
4404 @@ -2402,7 +2396,7 @@ else
4405    ac_save_LIBS="$LIBS"
4406  LIBS="-ltermcap  $LIBS"
4407  cat > conftest.$ac_ext <<EOF
4408 -#line 2406 "configure"
4409 +#line 2400 "configure"
4410  #include "confdefs.h"
4411  /* Override any gcc2 internal prototype to avoid an error.  */
4412  /* We use char because int might match the return type of a gcc2
4413 @@ -2413,7 +2407,7 @@ int main() {
4414  tgetent()
4415  ; return 0; }
4416  EOF
4417 -if { (eval echo configure:2417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4418 +if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4419    rm -rf conftest*
4420    eval "ac_cv_lib_$ac_lib_var=yes"
4421  else
4422 @@ -2432,7 +2426,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l
4423  else
4424    echo "$ac_t""no" 1>&6
4425  echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
4426 -echo "configure:2436: checking for tgetent in -lcurses" >&5
4427 +echo "configure:2430: checking for tgetent in -lcurses" >&5
4428  ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
4429  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4430    echo $ac_n "(cached) $ac_c" 1>&6
4431 @@ -2440,7 +2434,7 @@ else
4432    ac_save_LIBS="$LIBS"
4433  LIBS="-lcurses  $LIBS"
4434  cat > conftest.$ac_ext <<EOF
4435 -#line 2444 "configure"
4436 +#line 2438 "configure"
4437  #include "confdefs.h"
4438  /* Override any gcc2 internal prototype to avoid an error.  */
4439  /* We use char because int might match the return type of a gcc2
4440 @@ -2451,7 +2445,7 @@ int main() {
4441  tgetent()
4442  ; return 0; }
4443  EOF
4444 -if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4445 +if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4446    rm -rf conftest*
4447    eval "ac_cv_lib_$ac_lib_var=yes"
4448  else
4449 @@ -2470,7 +2464,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l
4450  else
4451    echo "$ac_t""no" 1>&6
4452  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
4453 -echo "configure:2474: checking for tgetent in -lncurses" >&5
4454 +echo "configure:2468: checking for tgetent in -lncurses" >&5
4455  ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
4456  if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4457    echo $ac_n "(cached) $ac_c" 1>&6
4458 @@ -2478,7 +2472,7 @@ else
4459    ac_save_LIBS="$LIBS"
4460  LIBS="-lncurses  $LIBS"
4461  cat > conftest.$ac_ext <<EOF
4462 -#line 2482 "configure"
4463 +#line 2476 "configure"
4464  #include "confdefs.h"
4465  /* Override any gcc2 internal prototype to avoid an error.  */
4466  /* We use char because int might match the return type of a gcc2
4467 @@ -2489,7 +2483,7 @@ int main() {
4468  tgetent()
4469  ; return 0; }
4470  EOF
4471 -if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4472 +if { (eval echo configure:2487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4473    rm -rf conftest*
4474    eval "ac_cv_lib_$ac_lib_var=yes"
4475  else
4476 @@ -2518,7 +2512,7 @@ fi
4478  if test "X$_bash_needmsg" = "Xyes"; then
4479  echo $ac_n "checking which library has the termcap functions""... $ac_c" 1>&6
4480 -echo "configure:2522: checking which library has the termcap functions" >&5
4481 +echo "configure:2516: checking which library has the termcap functions" >&5
4482  fi
4483  echo "$ac_t""using $bash_cv_termcap_lib" 1>&6
4484  if test $bash_cv_termcap_lib = gnutermcap && test -z "$prefer_curses"; then
4485 @@ -2542,7 +2536,7 @@ fi
4487  case "$host_cpu" in
4488  *cray*)        LOCAL_CFLAGS=-DCRAY ;;
4489 -*s390*)        LOCAL_CFLAGS=-fsigned-char ;;
4490 +*s390*) LOCAL_CFLAGS=-fsigned-char ;;
4491  esac
4493  case "$host_os" in
4494 @@ -2556,7 +2550,7 @@ esac
4496  if test -f ${srcdir}/support/shobj-conf; then
4497          echo $ac_n "checking configuration for building shared libraries""... $ac_c" 1>&6
4498 -echo "configure:2559: checking configuration for building shared libraries" >&5
4499 +echo "configure:2554: checking configuration for building shared libraries" >&5
4500          eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
4501          
4502          
4503 @@ -2740,10 +2734,9 @@ s%@host_alias@%$host_alias%g
4504  s%@host_cpu@%$host_cpu%g
4505  s%@host_vendor@%$host_vendor%g
4506  s%@host_os@%$host_os%g
4507 +s%@SET_MAKE@%$SET_MAKE%g
4508  s%@CC@%$CC%g
4509  s%@CPP@%$CPP%g
4510 -s%@CROSS_COMPILING_FLAG@%$CROSS_COMPILING_FLAG%g
4511 -s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g
4512  s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
4513  s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
4514  s%@INSTALL_DATA@%$INSTALL_DATA%g
4515 Index: readline/configure.in
4516 ===================================================================
4517 RCS file: /prjz/.cvsroot/gdb/readline/configure.in,v
4518 retrieving revision 1.1.1.1
4519 diff -u -3 -p -r1.1.1.1 configure.in
4520 --- readline/configure.in       2003/02/16 21:36:29     1.1.1.1
4521 +++ readline/configure.in       2001/04/02 19:55:12
4522 @@ -4,8 +4,8 @@ dnl
4523  dnl report bugs to chet@po.cwru.edu
4524  dnl
4525  dnl Process this file with autoconf to produce a configure script.
4526 -AC_REVISION([for Readline 4.1, version 2.22, from autoconf version] AC_ACVERSION)
4527 -LIBVERSION=4.1
4528 +AC_REVISION([for Readline 4.2, version 2.26, from autoconf version] AC_ACVERSION)
4529 +LIBVERSION=4.2
4531  AC_INIT(readline.h)
4532  AC_CONFIG_HEADER(config.h)
4533 @@ -13,7 +13,7 @@ AC_CONFIG_HEADER(config.h)
4534  dnl make sure we are using a recent autoconf version
4535  AC_PREREQ(2.10)
4537 -dnl AC_CONFIG_AUX_DIR(./support)
4538 +AC_CONFIG_AUX_DIR(./support)
4540  AC_CANONICAL_HOST
4542 @@ -31,48 +31,11 @@ fi
4543  # We want these before the checks, so the checks can modify their values.
4544  test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
4546 +AC_PROG_MAKE_SET
4547  AC_PROG_CC
4548  dnl AC_AIX
4549  AC_MINIX
4551 -dnl BEGIN changes for CYGNUS cross-building for Cygwin
4553 -dnl load up the cross-building cache file -- add more cases and cache
4554 -dnl files as necessary
4555 -if test "x$cross_compiling" = "xyes"; then
4556 -    case "${host}" in
4557 -    *-cygwin*)
4558 -       cross_cache=${srcdir}/cross-build/cygwin.cache
4559 -       if test -r "${cross_cache}"; then
4560 -           echo "loading cross-build cache file ${cross_cache}"
4561 -           . ${cross_cache}
4562 -       fi
4563 -       LOCAL_CFLAGS="$LOCAL_CFLAGS -I${srcdir}/../libtermcap"
4564 -       unset cross_cache
4565 -       ;;
4566 -    *)  echo "configure: cross-compiling for a non-cygwin target is not supported" >&2
4567 -       ;;
4568 -    esac
4571 -if test "x$cross_compiling" = "xyes"; then
4572 -  CROSS_COMPILING_FLAG=-DCROSS_COMPILING
4573 -else
4574 -  CROSS_COMPILING_FLAG=
4576 -AC_SUBST(CROSS_COMPILING_FLAG)
4578 -if test -z "$CC_FOR_BUILD"; then
4579 -    if test "x$cross_compiling" = "xno"; then
4580 -        CC_FOR_BUILD='$(CC)'
4581 -    else
4582 -        CC_FOR_BUILD=gcc
4583 -    fi
4585 -AC_SUBST(CC_FOR_BUILD)
4587 -dnl END changes for CYGNUS cross-building for Cygwin
4589  # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
4590  test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"
4592 @@ -129,7 +92,7 @@ fi
4594  case "$host_cpu" in
4595  *cray*)        LOCAL_CFLAGS=-DCRAY ;;
4596 -*s390*)        LOCAL_CFLAGS=-fsigned-char ;;
4597 +*s390*) LOCAL_CFLAGS=-fsigned-char ;;
4598  esac
4600  case "$host_os" in
4601 Index: readline/display.c
4602 ===================================================================
4603 RCS file: /prjz/.cvsroot/gdb/readline/display.c,v
4604 retrieving revision 1.1.1.1
4605 diff -u -3 -p -r1.1.1.1 display.c
4606 --- readline/display.c  2003/02/16 21:36:30     1.1.1.1
4607 +++ readline/display.c  2003/02/17 12:47:09
4608 @@ -41,10 +41,6 @@
4610  #include <stdio.h>
4612 -#ifdef __MSDOS__
4613 -# include <pc.h>
4614 -#endif
4616  /* System-specific feature definitions and include files. */
4617  #include "rldefs.h"
4619 @@ -58,19 +54,33 @@
4620  #include "rlprivate.h"
4621  #include "xmalloc.h"
4623 +#ifdef __MINGW32__
4624 +#include <windows.h>
4625 +extern int haveConsole;
4626 +extern HANDLE hStdout, hStdin;
4627 +extern COORD rlScreenEnd;
4628 +extern int rlScreenMax;
4629 +#endif /* __MINGW32__ */
4631  #if !defined (strchr) && !defined (__STDC__)
4632  extern char *strchr (), *strrchr ();
4633  #endif /* !strchr && !__STDC__ */
4635  #if defined (HACK_TERMCAP_MOTION)
4636 -extern char *term_forward_char;
4637 +extern char *_rl_term_forward_char;
4638  #endif
4640  static void update_line __P((char *, char *, int, int, int, int));
4641 -static void space_to_eol __P((int));
4642  static void delete_chars __P((int));
4643  static void insert_some_chars __P((char *, int));
4644 +#ifndef __MINGW32__
4645 +static void space_to_eol __P((int));
4646  static void cr __P((void));
4647 +#else
4648 +# define cr() _rl_move_cursor_relative (0, 0)
4649 +# define space_to_eol(count) _rl_clear_to_eol (count)
4650 +# define putc(ch, stream) _rl_output_character_function (ch)
4651 +#endif
4653  static int *inv_lbreaks, *vis_lbreaks;
4654  static int inv_lbsize, vis_lbsize;
4655 @@ -107,7 +117,7 @@ static int inv_lbsize, vis_lbsize;
4656     RL_DISPLAY_FIXED variable.  This is good for efficiency. */
4658  /* Application-specific redisplay function. */
4659 -VFunction *rl_redisplay_function = rl_redisplay;
4660 +rl_voidfunc_t *rl_redisplay_function = rl_redisplay;
4662  /* Global variables declared here. */
4663  /* What YOU turn on when you have handled all redisplay yourself. */
4664 @@ -146,27 +156,40 @@ static int forced_display;
4665  /* Default and initial buffer size.  Can grow. */
4666  static int line_size = 1024;
4668 +/* Variables to keep track of the expanded prompt string, which may
4669 +   include invisible characters. */
4671  static char *local_prompt, *local_prompt_prefix;
4672 -static int visible_length, prefix_length;
4673 +static int prompt_visible_length, prompt_prefix_length;
4675  /* The number of invisible characters in the line currently being
4676     displayed on the screen. */
4677  static int visible_wrap_offset;
4679 -/* static so it can be shared between rl_redisplay and update_line */
4680 +/* The number of invisible characters in the prompt string.  Static so it
4681 +   can be shared between rl_redisplay and update_line */
4682  static int wrap_offset;
4684 -/* The index of the last invisible_character in the prompt string. */
4685 -static int last_invisible;
4686 +/* The index of the last invisible character in the prompt string. */
4687 +static int prompt_last_invisible;
4689  /* The length (buffer offset) of the first line of the last (possibly
4690     multi-line) buffer displayed on the screen. */
4691  static int visible_first_line_len;
4693 +/* Number of invisible characters on the first physical line of the prompt.
4694 +   Only valid when the number of physical characters in the prompt exceeds
4695 +   (or is equal to) _rl_screenwidth. */
4696 +static int prompt_invis_chars_first_line;
4698 +static int prompt_last_screen_line;
4700  /* Expand the prompt string S and return the number of visible
4701     characters in *LP, if LP is not null.  This is currently more-or-less
4702     a placeholder for expansion.  LIP, if non-null is a place to store the
4703 -   index of the last invisible character in the returned string. */
4704 +   index of the last invisible character in the returned string. NIFLP,
4705 +   if non-zero, is a place to store the number of invisible characters in
4706 +   the first prompt line. */
4708  /* Current implementation:
4709         \001 (^A) start non-visible characters
4710 @@ -176,12 +199,12 @@ static int visible_first_line_len;
4711     \002 are assumed to be `visible'. */        
4713  static char *
4714 -expand_prompt (pmt, lp, lip)
4715 +expand_prompt (pmt, lp, lip, niflp)
4716       char *pmt;
4717 -     int *lp, *lip;
4718 +     int *lp, *lip, *niflp;
4720    char *r, *ret, *p;
4721 -  int l, rl, last, ignoring;
4722 +  int l, rl, last, ignoring, ninvis, invfl;
4724    /* Short-circuit if we can. */
4725    if (strchr (pmt, RL_PROMPT_START_IGNORE) == 0)
4726 @@ -194,8 +217,10 @@ expand_prompt (pmt, lp, lip)
4728    l = strlen (pmt);
4729    r = ret = xmalloc (l + 1);
4730 -  
4731 -  for (rl = ignoring = last = 0, p = pmt; p && *p; p++)
4733 +  invfl = 0;   /* invisible chars in first line of prompt */
4735 +  for (rl = ignoring = last = ninvis = 0, p = pmt; p && *p; p++)
4736      {
4737        /* This code strips the invisible character string markers
4738          RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */
4739 @@ -215,14 +240,23 @@ expand_prompt (pmt, lp, lip)
4740           *r++ = *p;
4741           if (!ignoring)
4742             rl++;
4743 +         else
4744 +           ninvis++;
4745 +         if (rl == _rl_screenwidth)
4746 +           invfl = ninvis;
4747         }
4748      }
4750 +  if (rl < _rl_screenwidth)
4751 +    invfl = ninvis;
4753    *r = '\0';
4754    if (lp)
4755      *lp = rl;
4756    if (lip)
4757      *lip = last;
4758 +  if (niflp)
4759 +    *niflp = invfl;
4760    return ret;
4763 @@ -234,7 +268,7 @@ _rl_strip_prompt (pmt)
4765    char *ret;
4767 -  ret = expand_prompt (pmt, (int *)NULL, (int *)NULL);
4768 +  ret = expand_prompt (pmt, (int *)NULL, (int *)NULL, (int *)NULL);
4769    return ret;
4772 @@ -246,8 +280,8 @@ _rl_strip_prompt (pmt)
4773   *               (portion after the final newline)
4774   * local_prompt_prefix = portion before last newline of rl_display_prompt,
4775   *                      expanded via expand_prompt
4776 - * visible_length = number of visible characters in local_prompt
4777 - * prefix_length = number of visible characters in local_prompt_prefix
4778 + * prompt_visible_length = number of visible characters in local_prompt
4779 + * prompt_prefix_length = number of visible characters in local_prompt_prefix
4780   *
4781   * This function is called once per call to readline().  It may also be
4782   * called arbitrarily to expand the primary prompt.
4783 @@ -263,12 +297,11 @@ rl_expand_prompt (prompt)
4784    int c;
4786    /* Clear out any saved values. */
4787 -  if (local_prompt)
4788 -    free (local_prompt);
4789 -  if (local_prompt_prefix)
4790 -    free (local_prompt_prefix);
4791 +  FREE (local_prompt);
4792 +  FREE (local_prompt_prefix);
4794    local_prompt = local_prompt_prefix = (char *)0;
4795 -  last_invisible = visible_length = 0;
4796 +  prompt_last_invisible = prompt_visible_length = 0;
4798    if (prompt == 0 || *prompt == 0)
4799      return (0);
4800 @@ -276,22 +309,28 @@ rl_expand_prompt (prompt)
4801    p = strrchr (prompt, '\n');
4802    if (!p)
4803      {
4804 -      /* The prompt is only one line. */
4805 -      local_prompt = expand_prompt (prompt, &visible_length, &last_invisible);
4806 +      /* The prompt is only one logical line, though it might wrap. */
4807 +      local_prompt = expand_prompt (prompt, &prompt_visible_length,
4808 +                                           &prompt_last_invisible,
4809 +                                           &prompt_invis_chars_first_line);
4810        local_prompt_prefix = (char *)0;
4811 -      return (visible_length);
4812 +      return (prompt_visible_length);
4813      }
4814    else
4815      {
4816        /* The prompt spans multiple lines. */
4817        t = ++p;
4818 -      local_prompt = expand_prompt (p, &visible_length, &last_invisible);
4819 +      local_prompt = expand_prompt (p, &prompt_visible_length,
4820 +                                      &prompt_last_invisible,
4821 +                                      &prompt_invis_chars_first_line);
4822        c = *t; *t = '\0';
4823        /* The portion of the prompt string up to and including the
4824          final newline is now null-terminated. */
4825 -      local_prompt_prefix = expand_prompt (prompt, &prefix_length, (int *)NULL);
4826 +      local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
4827 +                                                  (int *)NULL,
4828 +                                                  &prompt_invis_chars_first_line);
4829        *t = c;
4830 -      return (prefix_length);
4831 +      return (prompt_prefix_length);
4832      }
4835 @@ -403,7 +442,7 @@ rl_redisplay ()
4836           out += local_len;
4837         }
4838        line[out] = '\0';
4839 -      wrap_offset = local_len - visible_length;
4840 +      wrap_offset = local_len - prompt_visible_length;
4841      }
4842    else
4843      {
4844 @@ -436,7 +475,7 @@ rl_redisplay ()
4845        strncpy (line + out,  prompt_this_line, pmtlen);
4846        out += pmtlen;
4847        line[out] = '\0';
4848 -      wrap_offset = 0;
4849 +      wrap_offset = prompt_invis_chars_first_line = 0;
4850      }
4852  #define CHECK_INV_LBREAKS() \
4853 @@ -451,7 +490,7 @@ rl_redisplay ()
4854  #define CHECK_LPOS() \
4855        do { \
4856         lpos++; \
4857 -       if (lpos >= screenwidth) \
4858 +       if (lpos >= _rl_screenwidth) \
4859           { \
4860             if (newlines >= (inv_lbsize - 2)) \
4861               { \
4862 @@ -466,22 +505,37 @@ rl_redisplay ()
4863    /* inv_lbreaks[i] is where line i starts in the buffer. */
4864    inv_lbreaks[newlines = 0] = 0;
4865    lpos = out - wrap_offset;
4867 +  /* prompt_invis_chars_first_line is the number of invisible characters in
4868 +     the first physical line of the prompt.
4869 +     wrap_offset - prompt_invis_chars_first_line is the number of invis
4870 +     chars on the second line. */
4872 -  /* XXX - what if lpos is already >= screenwidth before we start drawing the
4873 +  /* what if lpos is already >= _rl_screenwidth before we start drawing the
4874       contents of the command line? */
4875 -  while (lpos >= screenwidth)
4876 +  while (lpos >= _rl_screenwidth)
4877      {
4878 -      /* XXX - possible fix from Darin Johnson <darin@acuson.com> for prompt
4879 -        string with invisible characters that is longer than the screen
4880 -        width.  XXX - this doesn't work right if invisible characters have
4881 -        to be put on the second screen line -- it adds too much (the number
4882 -        of invisible chars after the screenwidth). */
4883 -      temp = ((newlines + 1) * screenwidth) + ((newlines == 0) ? wrap_offset : 0);
4884 +      /* fix from Darin Johnson <darin@acuson.com> for prompt string with
4885 +         invisible characters that is longer than the screen width.  The
4886 +         prompt_invis_chars_first_line variable could be made into an array
4887 +         saying how many invisible characters there are per line, but that's
4888 +         probably too much work for the benefit gained.  How many people have
4889 +         prompts that exceed two physical lines? */
4890 +      temp = ((newlines + 1) * _rl_screenwidth) +
4891 +             ((newlines == 0) ? prompt_invis_chars_first_line : 0) +
4892 +             ((newlines == 1) ? wrap_offset : 0);
4894        inv_lbreaks[++newlines] = temp;
4895 -      lpos -= screenwidth;
4896 +      lpos -= _rl_screenwidth;
4897      }
4899 +  prompt_last_screen_line = newlines;
4901 +  /* Draw the rest of the line (after the prompt) into invisible_line, keeping
4902 +     track of where the cursor is (c_pos), the number of the line containing
4903 +     the cursor (lb_linenum), the last line number (lb_botlin and inv_botlin).
4904 +     It maintains an array of line breaks for display (inv_lbreaks).
4905 +     This handles expanding tabs for display and displaying meta characters. */
4906    lb_linenum = 0;
4907    for (in = 0; in < rl_end; in++)
4908      {
4909 @@ -507,9 +561,9 @@ rl_redisplay ()
4910             {
4911               sprintf (line + out, "\\%o", c);
4913 -             if (lpos + 4 >= screenwidth)
4914 +             if (lpos + 4 >= _rl_screenwidth)
4915                 {
4916 -                 temp = screenwidth - lpos;
4917 +                 temp = _rl_screenwidth - lpos;
4918                   CHECK_INV_LBREAKS ();
4919                   inv_lbreaks[++newlines] = out + temp;
4920                   lpos = 4 - temp;
4921 @@ -528,7 +582,7 @@ rl_redisplay ()
4922  #if defined (DISPLAY_TABS)
4923        else if (c == '\t')
4924         {
4925 -         register int temp, newout;
4926 +         register int newout;
4928  #if 0
4929           newout = (out | (int)7) + 1;
4930 @@ -536,10 +590,10 @@ rl_redisplay ()
4931           newout = out + 8 - lpos % 8;
4932  #endif
4933           temp = newout - out;
4934 -         if (lpos + temp >= screenwidth)
4935 +         if (lpos + temp >= _rl_screenwidth)
4936             {
4937               register int temp2;
4938 -             temp2 = screenwidth - lpos;
4939 +             temp2 = _rl_screenwidth - lpos;
4940               CHECK_INV_LBREAKS ();
4941               inv_lbreaks[++newlines] = out + temp2;
4942               lpos = temp - temp2;
4943 @@ -554,7 +608,7 @@ rl_redisplay ()
4944             }
4945         }
4946  #endif
4947 -      else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && term_up && *term_up)
4948 +      else if (c == '\n' && _rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up)
4949         {
4950           line[out++] = '\0';   /* XXX - sentinel */
4951           CHECK_INV_LBREAKS ();
4952 @@ -586,7 +640,8 @@ rl_redisplay ()
4953    inv_lbreaks[newlines+1] = out;
4954    cursor_linenum = lb_linenum;
4956 -  /* C_POS == position in buffer where cursor should be placed. */
4957 +  /* C_POS == position in buffer where cursor should be placed.
4958 +     CURSOR_LINENUM == line number where the cursor should be placed. */
4960    /* PWP: now is when things get a bit hairy.  The visible and invisible
4961       line buffers are really multiple lines, which would wrap every
4962 @@ -597,7 +652,7 @@ rl_redisplay ()
4963       otherwise, let long lines display in a single terminal line, and
4964       horizontally scroll it. */
4966 -  if (_rl_horizontal_scroll_mode == 0 && term_up && *term_up)
4967 +  if (_rl_horizontal_scroll_mode == 0 && _rl_term_up && *_rl_term_up)
4968      {
4969        int nleft, pos, changed_screen_line;
4971 @@ -608,8 +663,8 @@ rl_redisplay ()
4972           /* If we have more than a screenful of material to display, then
4973              only display a screenful.  We should display the last screen,
4974              not the first.  */
4975 -         if (out >= screenchars)
4976 -           out = screenchars - 1;
4977 +         if (out >= _rl_screenchars)
4978 +           out = _rl_screenchars - 1;
4980           /* The first line is at character position 0 in the buffer.  The
4981              second and subsequent lines start at inv_lbreaks[N], offset by
4982 @@ -639,7 +694,7 @@ rl_redisplay ()
4983                   (wrap_offset > visible_wrap_offset) &&
4984                   (_rl_last_c_pos < visible_first_line_len))
4985                 {
4986 -                 nleft = screenwidth + wrap_offset - _rl_last_c_pos;
4987 +                 nleft = _rl_screenwidth + wrap_offset - _rl_last_c_pos;
4988                   if (nleft)
4989                     _rl_clear_to_eol (nleft);
4990                 }
4991 @@ -660,7 +715,7 @@ rl_redisplay ()
4992                   _rl_move_vert (linenum);
4993                   _rl_move_cursor_relative (0, tt);
4994                   _rl_clear_to_eol
4995 -                   ((linenum == _rl_vis_botlin) ? strlen (tt) : screenwidth);
4996 +                   ((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth);
4997                 }
4998             }
4999           _rl_vis_botlin = inv_botlin;
5000 @@ -671,7 +726,7 @@ rl_redisplay ()
5001           if (changed_screen_line)
5002             {
5003               _rl_move_vert (cursor_linenum);
5004 -             /* If we moved up to the line with the prompt using term_up,
5005 +             /* If we moved up to the line with the prompt using _rl_term_up,
5006                  the physical cursor position on the screen stays the same,
5007                  but the buffer position needs to be adjusted to account
5008                  for invisible characters. */
5009 @@ -684,15 +739,17 @@ rl_redisplay ()
5010              the characters from the current cursor position.  But we
5011              only need to reprint it if the cursor is before the last
5012              invisible character in the prompt string. */
5013 -         nleft = visible_length + wrap_offset;
5014 +         nleft = prompt_visible_length + wrap_offset;
5015           if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
5016 -             _rl_last_c_pos <= last_invisible && local_prompt)
5017 +             _rl_last_c_pos <= prompt_last_invisible && local_prompt)
5018             {
5019  #if defined (__MSDOS__)
5020               putc ('\r', rl_outstream);
5021 +#elif defined (__MINGW32__)
5022 +             cr ();
5023  #else
5024 -             if (term_cr)
5025 -               tputs (term_cr, 1, _rl_output_character_function);
5026 +             if (_rl_term_cr)
5027 +               tputs (_rl_term_cr, 1, _rl_output_character_function);
5028  #endif
5029               _rl_output_some_chars (local_prompt, nleft);
5030               _rl_last_c_pos = nleft;
5031 @@ -731,11 +788,11 @@ rl_redisplay ()
5033        /* The number of characters that will be displayed before the cursor. */
5034        ndisp = c_pos - wrap_offset;
5035 -      nleft  = visible_length + wrap_offset;
5036 +      nleft  = prompt_visible_length + wrap_offset;
5037        /* Where the new cursor position will be on the screen.  This can be
5038          longer than SCREENWIDTH; if it is, lmargin will be adjusted. */
5039        phys_c_pos = c_pos - (last_lmargin ? last_lmargin : wrap_offset);
5040 -      t = screenwidth / 3;
5041 +      t = _rl_screenwidth / 3;
5043        /* If the number of characters had already exceeded the screenwidth,
5044          last_lmargin will be > 0. */
5045 @@ -743,7 +800,7 @@ rl_redisplay ()
5046        /* If the number of characters to be displayed is more than the screen
5047          width, compute the starting offset so that the cursor is about
5048          two-thirds of the way across the screen. */
5049 -      if (phys_c_pos > screenwidth - 2)
5050 +      if (phys_c_pos > _rl_screenwidth - 2)
5051         {
5052           lmargin = c_pos - (2 * t);
5053           if (lmargin < 0)
5054 @@ -753,7 +810,7 @@ rl_redisplay ()
5055           if (wrap_offset && lmargin > 0 && lmargin < nleft)
5056             lmargin = nleft;
5057         }
5058 -      else if (ndisp < screenwidth - 2)                /* XXX - was -1 */
5059 +      else if (ndisp < _rl_screenwidth - 2)            /* XXX - was -1 */
5060         lmargin = 0;
5061        else if (phys_c_pos < 1)
5062         {
5063 @@ -775,7 +832,7 @@ rl_redisplay ()
5064          the whole line, indicate that with a special character at the
5065          right edge of the screen.  If LMARGIN is 0, we need to take the
5066          wrap offset into account. */
5067 -      t = lmargin + M_OFFSET (lmargin, wrap_offset) + screenwidth;
5068 +      t = lmargin + M_OFFSET (lmargin, wrap_offset) + _rl_screenwidth;
5069        if (t < out)
5070         line[t - 1] = '>';
5072 @@ -785,8 +842,8 @@ rl_redisplay ()
5073           update_line (&visible_line[last_lmargin],
5074                        &invisible_line[lmargin],
5075                        0,
5076 -                      screenwidth + visible_wrap_offset,
5077 -                      screenwidth + (lmargin ? 0 : wrap_offset),
5078 +                      _rl_screenwidth + visible_wrap_offset,
5079 +                      _rl_screenwidth + (lmargin ? 0 : wrap_offset),
5080                        0);
5082           /* If the visible new line is shorter than the old, but the number
5083 @@ -797,12 +854,12 @@ rl_redisplay ()
5084               (_rl_last_c_pos == out) &&
5085               t < visible_first_line_len)
5086             {
5087 -             nleft = screenwidth - t;
5088 +             nleft = _rl_screenwidth - t;
5089               _rl_clear_to_eol (nleft);
5090             }
5091           visible_first_line_len = out - lmargin - M_OFFSET (lmargin, wrap_offset);
5092 -         if (visible_first_line_len > screenwidth)
5093 -           visible_first_line_len = screenwidth;
5094 +         if (visible_first_line_len > _rl_screenwidth)
5095 +           visible_first_line_len = _rl_screenwidth;
5097           _rl_move_cursor_relative (c_pos - lmargin, &invisible_line[lmargin]);
5098           last_lmargin = lmargin;
5099 @@ -812,11 +869,11 @@ rl_redisplay ()
5101    /* Swap visible and non-visible lines. */
5102    {
5103 -    char *temp = visible_line;
5104 +    char *vtemp = visible_line;
5105      int *itemp = vis_lbreaks, ntemp = vis_lbsize;
5107      visible_line = invisible_line;
5108 -    invisible_line = temp;
5109 +    invisible_line = vtemp;
5111      vis_lbreaks = inv_lbreaks;
5112      inv_lbreaks = itemp;
5113 @@ -866,7 +923,7 @@ update_line (old, new, current_line, oma
5114       emulators.  In this calculation, TEMP is the physical screen
5115       position of the cursor. */
5116    temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
5117 -  if (temp == screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
5118 +  if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
5119        && _rl_last_v_pos == current_line - 1)
5120      {
5121        if (new[0])
5122 @@ -943,13 +1000,15 @@ update_line (old, new, current_line, oma
5123    lendiff = local_prompt ? strlen (local_prompt) : 0;
5124    od = ofd - old;      /* index of first difference in visible line */
5125    if (current_line == 0 && !_rl_horizontal_scroll_mode &&
5126 -      term_cr && lendiff > visible_length && _rl_last_c_pos > 0 &&
5127 -      od > lendiff && _rl_last_c_pos < last_invisible)
5128 +      _rl_term_cr && lendiff > prompt_visible_length && _rl_last_c_pos > 0 &&
5129 +      od >= lendiff && _rl_last_c_pos <= prompt_last_invisible)
5130      {
5131  #if defined (__MSDOS__)
5132        putc ('\r', rl_outstream);
5133 +#elif defined (__MINGW32__)
5134 +      cr ();
5135  #else
5136 -      tputs (term_cr, 1, _rl_output_character_function);
5137 +      tputs (_rl_term_cr, 1, _rl_output_character_function);
5138  #endif
5139        _rl_output_some_chars (local_prompt, lendiff);
5140        _rl_last_c_pos = lendiff;
5141 @@ -971,20 +1030,21 @@ update_line (old, new, current_line, oma
5142    temp = ne - nfd;
5143    if (lendiff > 0)
5144      {
5145 +#ifndef __MINGW32__
5146        /* Non-zero if we're increasing the number of lines. */
5147        int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
5148        /* Sometimes it is cheaper to print the characters rather than
5149          use the terminal's capabilities.  If we're growing the number
5150          of lines, make sure we actually cause the new line to wrap
5151          around on auto-wrapping terminals. */
5152 -      if (terminal_can_insert && ((2 * temp) >= lendiff || term_IC) && (!_rl_term_autowrap || !gl))
5153 +      if (_rl_terminal_can_insert && ((2 * temp) >= lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
5154         {
5155 -         /* If lendiff > visible_length and _rl_last_c_pos == 0 and
5156 +         /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
5157              _rl_horizontal_scroll_mode == 1, inserting the characters with
5158 -            term_IC or term_ic will screw up the screen because of the
5159 +            _rl_term_IC or _rl_term_ic will screw up the screen because of the
5160              invisible characters.  We need to just draw them. */
5161           if (*ols && (!_rl_horizontal_scroll_mode || _rl_last_c_pos > 0 ||
5162 -                       lendiff <= visible_length || !current_invis_chars))
5163 +                       lendiff <= prompt_visible_length || !current_invis_chars))
5164             {
5165               insert_some_chars (nfd, lendiff);
5166               _rl_last_c_pos += lendiff;
5167 @@ -1016,6 +1076,7 @@ update_line (old, new, current_line, oma
5168             }
5169         }
5170        else
5171 +#endif /* !__MINGW32__ */
5172         {
5173           /* cannot insert chars, write to EOL */
5174           _rl_output_some_chars (nfd, temp);
5175 @@ -1024,8 +1085,9 @@ update_line (old, new, current_line, oma
5176      }
5177    else                         /* Delete characters from line. */
5178      {
5179 +#ifndef __MINGW32__
5180        /* If possible and inexpensive to use terminal deletion, then do so. */
5181 -      if (term_dc && (2 * temp) >= -lendiff)
5182 +      if (_rl_term_dc && (2 * temp) >= -lendiff)
5183         {
5184           /* If all we're doing is erasing the invisible characters in the
5185              prompt string, don't bother.  It screws up the assumptions
5186 @@ -1047,6 +1109,7 @@ update_line (old, new, current_line, oma
5187         }
5188        /* Otherwise, print over the existing material. */
5189        else
5190 +#endif /* !__MINGW32__ */
5191         {
5192           if (temp > 0)
5193             {
5194 @@ -1110,7 +1173,7 @@ rl_on_new_line_with_prompt ()
5195    /* Dissect prompt_last_line into screen lines. Note that here we have
5196       to use the real screenwidth. Readline's notion of screenwidth might be
5197       one less, see terminal.c. */
5198 -  real_screenwidth = screenwidth + (_rl_term_autowrap ? 0 : 1);
5199 +  real_screenwidth = _rl_screenwidth + (_rl_term_autowrap ? 0 : 1);
5200    _rl_last_v_pos = l / real_screenwidth;
5201    /* If the prompt length is a multiple of real_screenwidth, we don't know
5202       whether the cursor is at the end of the last line, or already at the
5203 @@ -1152,10 +1215,11 @@ rl_forced_update_display ()
5204  /* Move the cursor from _rl_last_c_pos to NEW, which are buffer indices.
5205     DATA is the contents of the screen line of interest; i.e., where
5206     the movement is being done. */
5207 +#ifndef __MINGW32__
5208  void
5209  _rl_move_cursor_relative (new, data)
5210       int new;
5211 -     char *data;
5212 +     const char *data;
5214    register int i;
5216 @@ -1167,12 +1231,12 @@ _rl_move_cursor_relative (new, data)
5217    /* i == current physical cursor position. */
5218    i = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
5219    if (new == 0 || CR_FASTER (new, _rl_last_c_pos) ||
5220 -      (_rl_term_autowrap && i == screenwidth))
5221 +      (_rl_term_autowrap && i == _rl_screenwidth))
5222      {
5223  #if defined (__MSDOS__)
5224        putc ('\r', rl_outstream);
5225  #else
5226 -      tputs (term_cr, 1, _rl_output_character_function);
5227 +      tputs (_rl_term_cr, 1, _rl_output_character_function);
5228  #endif /* !__MSDOS__ */
5229        _rl_last_c_pos = 0;
5230      }
5231 @@ -1189,9 +1253,9 @@ _rl_move_cursor_relative (new, data)
5232          That kind of control is for people who don't know what the
5233          data is underneath the cursor. */
5234  #if defined (HACK_TERMCAP_MOTION)
5235 -      if (term_forward_char)
5236 +      if (_rl_term_forward_char)
5237         for (i = _rl_last_c_pos; i < new; i++)
5238 -         tputs (term_forward_char, 1, _rl_output_character_function);
5239 +         tputs (_rl_term_forward_char, 1, _rl_output_character_function);
5240        else
5241         for (i = _rl_last_c_pos; i < new; i++)
5242           putc (data[i], rl_outstream);
5243 @@ -1212,7 +1276,7 @@ _rl_move_vert (to)
5245    register int delta, i;
5247 -  if (_rl_last_v_pos == to || to > screenheight)
5248 +  if (_rl_last_v_pos == to || to > _rl_screenheight)
5249      return;
5251    if ((delta = to - _rl_last_v_pos) > 0)
5252 @@ -1222,29 +1286,54 @@ _rl_move_vert (to)
5253  #if defined (__MSDOS__)
5254        putc ('\r', rl_outstream);
5255  #else
5256 -      tputs (term_cr, 1, _rl_output_character_function);
5257 +      tputs (_rl_term_cr, 1, _rl_output_character_function);
5258  #endif
5259        _rl_last_c_pos = 0;
5260      }
5261    else
5262      {                  /* delta < 0 */
5263 -#ifdef __MSDOS__
5264 -      int row, col;
5266 -      i = fflush (rl_outstream); /* make sure the cursor pos is current! */
5267 -      ScreenGetCursor (&row, &col);
5268 -      ScreenSetCursor ((row + to - _rl_last_v_pos), col);
5269 -      delta = i;
5270 -#else /* !__MSDOS__ */
5271 -      if (term_up && *term_up)
5272 +      if (_rl_term_up && *_rl_term_up)
5273         for (i = 0; i < -delta; i++)
5274 -         tputs (term_up, 1, _rl_output_character_function);
5275 -#endif /* !__MSDOS__ */
5276 +         tputs (_rl_term_up, 1, _rl_output_character_function);
5277      }
5279    _rl_last_v_pos = to;         /* Now TO is here */
5282 +#else /* __MINGW32__ */
5284 +void
5285 +_rl_move_cursor_relative (new, data)
5286 +     int new;
5287 +     const char *data;
5289 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
5290 +  if ( (_rl_last_c_pos != new)
5291 +       && haveConsole && GetConsoleScreenBufferInfo(hStdout, &csbi) )
5292 +    {
5293 +      csbi.dwCursorPosition.X += new - _rl_last_c_pos;
5294 +      if ( SetConsoleCursorPosition(hStdout, csbi.dwCursorPosition) )
5295 +       _rl_last_c_pos = new;
5296 +    }
5297 +  return;
5300 +void
5301 +_rl_move_vert (to)
5302 +     int to;
5304 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
5305 +  if ( (_rl_last_v_pos != to) && (to <= _rl_screenheight)
5306 +       && haveConsole && GetConsoleScreenBufferInfo(hStdout, &csbi) )
5307 +    {
5308 +      csbi.dwCursorPosition.Y += to - _rl_last_v_pos;
5309 +      if ( SetConsoleCursorPosition(hStdout, csbi.dwCursorPosition) )
5310 +       _rl_last_v_pos = to;
5311 +    }
5314 +#endif /* __MINGW32__ */
5316  /* Physically print C on rl_outstream.  This is for functions which know
5317     how to optimize the display.  Return the number of characters output. */
5318  int
5319 @@ -1373,25 +1462,23 @@ rl_save_prompt ()
5321    saved_local_prompt = local_prompt;
5322    saved_local_prefix = local_prompt_prefix;
5323 -  saved_last_invisible = last_invisible;
5324 -  saved_visible_length = visible_length;
5325 +  saved_last_invisible = prompt_last_invisible;
5326 +  saved_visible_length = prompt_visible_length;
5328    local_prompt = local_prompt_prefix = (char *)0;
5329 -  last_invisible = visible_length = 0;
5330 +  prompt_last_invisible = prompt_visible_length = 0;
5333  void
5334  rl_restore_prompt ()
5336 -  if (local_prompt)
5337 -    free (local_prompt);
5338 -  if (local_prompt_prefix)
5339 -    free (local_prompt_prefix);
5340 +  FREE (local_prompt);
5341 +  FREE (local_prompt_prefix);
5343    local_prompt = saved_local_prompt;
5344    local_prompt_prefix = saved_local_prefix;
5345 -  last_invisible = saved_last_invisible;
5346 -  visible_length = saved_visible_length;
5347 +  prompt_last_invisible = saved_last_invisible;
5348 +  prompt_visible_length = saved_visible_length;
5351  char *
5352 @@ -1421,8 +1508,8 @@ _rl_make_prompt_for_search (pchar)
5353        pmt[len] = pchar;
5354        pmt[len+1] = '\0';
5355        local_prompt = savestring (pmt);
5356 -      last_invisible = saved_last_invisible;
5357 -      visible_length = saved_visible_length + 1;
5358 +      prompt_last_invisible = saved_last_invisible;
5359 +      prompt_visible_length = saved_visible_length + 1;
5360      }
5361    return pmt;
5363 @@ -1445,16 +1532,14 @@ _rl_erase_at_end_of_line (l)
5365  /* Clear to the end of the line.  COUNT is the minimum
5366     number of character spaces to clear, */
5367 +#ifndef __MINGW32__ /* replace next two functions */
5368  void
5369  _rl_clear_to_eol (count)
5370       int count;
5372 -#ifndef __MSDOS__
5373 -  if (term_clreol)
5374 -    tputs (term_clreol, 1, _rl_output_character_function);
5375 -  else
5376 -#endif
5377 -  if (count)
5378 +  if (_rl_term_clreol)
5379 +    tputs (_rl_term_clreol, 1, _rl_output_character_function);
5380 +  else if (count)
5381      space_to_eol (count);
5384 @@ -1472,34 +1557,55 @@ space_to_eol (count)
5385    _rl_last_c_pos += count;
5388 +#else  /* __MINGW32__ */
5390  void
5391 +_rl_clear_to_eol (count)
5392 +     int count;
5394 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
5395 +  if (haveConsole && GetConsoleScreenBufferInfo(hStdout, &csbi))
5396 +    {
5397 +      DWORD written;
5398 +      int linear_pos;
5399 +      
5400 +      linear_pos = (int)csbi.dwCursorPosition.Y * (int)csbi.dwSize.X
5401 +       + (int)csbi.dwCursorPosition.X;
5402 +      if (linear_pos < rlScreenMax)
5403 +       {
5404 +         rlScreenEnd = csbi.dwCursorPosition;
5405 +         rlScreenMax = linear_pos;
5406 +       }
5407 +      FillConsoleOutputCharacter(hStdout, ' ', count, csbi.dwCursorPosition, &written);
5408 +    }
5409 +  return;
5412 +#endif /* __MINGW32__ */
5414 +void
5415  _rl_clear_screen ()
5417 -#if defined (__GO32__)
5418 -  ScreenClear ();      /* FIXME: only works in text modes */
5419 -  ScreenSetCursor (0, 0);  /* term_clrpag is "cl" which homes the cursor */
5420 -#else
5421 -  if (term_clrpag)
5422 -    tputs (term_clrpag, 1, _rl_output_character_function);
5423 +#ifndef __MINGW32__
5424 +  if (_rl_term_clrpag)
5425 +    tputs (_rl_term_clrpag, 1, _rl_output_character_function);
5426    else
5427 -    crlf ();
5428  #endif
5429 +    rl_crlf ();
5432 +#ifndef __MINGW32__
5433  /* Insert COUNT characters from STRING to the output stream. */
5434  static void
5435  insert_some_chars (string, count)
5436       char *string;
5437       int count;
5439 -#ifdef __MSDOS__
5440 -  _rl_output_some_chars (string, count);
5441 -#else  /* !__MSDOS__ */
5442    /* If IC is defined, then we do not have to "enter" insert mode. */
5443 -  if (term_IC)
5444 +  if (_rl_term_IC)
5445      {
5446        char *buffer;
5447 -      buffer = tgoto (term_IC, 0, count);
5448 +      buffer = tgoto (_rl_term_IC, 0, count);
5449        tputs (buffer, 1, _rl_output_character_function);
5450        _rl_output_some_chars (string, count);
5451      }
5452 @@ -1508,15 +1614,15 @@ insert_some_chars (string, count)
5453        register int i;
5455        /* If we have to turn on insert-mode, then do so. */
5456 -      if (term_im && *term_im)
5457 -       tputs (term_im, 1, _rl_output_character_function);
5458 +      if (_rl_term_im && *_rl_term_im)
5459 +       tputs (_rl_term_im, 1, _rl_output_character_function);
5461        /* If there is a special command for inserting characters, then
5462          use that first to open up the space. */
5463 -      if (term_ic && *term_ic)
5464 +      if (_rl_term_ic && *_rl_term_ic)
5465         {
5466           for (i = count; i--; )
5467 -           tputs (term_ic, 1, _rl_output_character_function);
5468 +           tputs (_rl_term_ic, 1, _rl_output_character_function);
5469         }
5471        /* Print the text. */
5472 @@ -1524,10 +1630,9 @@ insert_some_chars (string, count)
5474        /* If there is a string to turn off insert mode, we had best use
5475          it now. */
5476 -      if (term_ei && *term_ei)
5477 -       tputs (term_ei, 1, _rl_output_character_function);
5478 +      if (_rl_term_ei && *_rl_term_ei)
5479 +       tputs (_rl_term_ei, 1, _rl_output_character_function);
5480      }
5481 -#endif /* !__MSDOS__ */
5484  /* Delete COUNT characters from the display line. */
5485 @@ -1535,24 +1640,23 @@ static void
5486  delete_chars (count)
5487       int count;
5489 -  if (count > screenwidth)     /* XXX */
5490 +  if (count > _rl_screenwidth) /* XXX */
5491      return;
5493 -#ifndef __MSDOS__
5494 -  if (term_DC && *term_DC)
5495 +  if (_rl_term_DC && *_rl_term_DC)
5496      {
5497        char *buffer;
5498 -      buffer = tgoto (term_DC, count, count);
5499 +      buffer = tgoto (_rl_term_DC, count, count);
5500        tputs (buffer, count, _rl_output_character_function);
5501      }
5502    else
5503      {
5504 -      if (term_dc && *term_dc)
5505 +      if (_rl_term_dc && *_rl_term_dc)
5506         while (count--)
5507 -         tputs (term_dc, 1, _rl_output_character_function);
5508 +         tputs (_rl_term_dc, 1, _rl_output_character_function);
5509      }
5510 -#endif /* !__MSDOS__ */
5512 +#endif /* !__MINGW32__ */
5514  void
5515  _rl_update_final ()
5516 @@ -1570,7 +1674,7 @@ _rl_update_final ()
5517      }
5518    _rl_move_vert (_rl_vis_botlin);
5519    /* If we've wrapped lines, remove the final xterm line-wrap flag. */
5520 -  if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == screenwidth))
5521 +  if (full_lines && _rl_term_autowrap && (VIS_LLEN(_rl_vis_botlin) == _rl_screenwidth))
5522      {
5523        char *last_line;
5524  #if 0
5525 @@ -1578,30 +1682,32 @@ _rl_update_final ()
5526  #else
5527        last_line = &visible_line[vis_lbreaks[_rl_vis_botlin]];
5528  #endif
5529 -      _rl_move_cursor_relative (screenwidth - 1, last_line);
5530 +      _rl_move_cursor_relative (_rl_screenwidth - 1, last_line);
5531        _rl_clear_to_eol (0);
5532 -      putc (last_line[screenwidth - 1], rl_outstream);
5533 +      putc (last_line[_rl_screenwidth - 1], rl_outstream);
5534      }
5535    _rl_vis_botlin = 0;
5536 -  crlf ();
5537 +  rl_crlf ();
5538    fflush (rl_outstream);
5539    rl_display_fixed++;
5542 +#ifndef __MINGW32__
5543  /* Move to the start of the current line. */
5544  static void
5545  cr ()
5547 -  if (term_cr)
5548 +  if (_rl_term_cr)
5549      {
5550  #if defined (__MSDOS__)
5551        putc ('\r', rl_outstream);
5552  #else
5553 -      tputs (term_cr, 1, _rl_output_character_function);
5554 +      tputs (_rl_term_cr, 1, _rl_output_character_function);
5555  #endif
5556        _rl_last_c_pos = 0;
5557      }
5559 +#endif
5561  /* Redraw the last line of a multi-line prompt that may possibly contain
5562     terminal escape sequences.  Called with the cursor at column 0 of the
5563 @@ -1611,27 +1717,31 @@ redraw_prompt (t)
5564       char *t;
5566    char *oldp, *oldl, *oldlprefix;
5567 -  int oldlen, oldlast, oldplen;
5568 +  int oldlen, oldlast, oldplen, oldninvis;
5570    /* Geez, I should make this a struct. */
5571    oldp = rl_display_prompt;
5572    oldl = local_prompt;
5573    oldlprefix = local_prompt_prefix;
5574 -  oldlen = visible_length;
5575 -  oldplen = prefix_length;
5576 -  oldlast = last_invisible;
5577 +  oldlen = prompt_visible_length;
5578 +  oldplen = prompt_prefix_length;
5579 +  oldlast = prompt_last_invisible;
5580 +  oldninvis = prompt_invis_chars_first_line;
5582    rl_display_prompt = t;
5583 -  local_prompt = expand_prompt (t, &visible_length, &last_invisible);
5584 +  local_prompt = expand_prompt (t, &prompt_visible_length,
5585 +                                  &prompt_last_invisible,
5586 +                                  &prompt_invis_chars_first_line);
5587    local_prompt_prefix = (char *)NULL;
5588    rl_forced_update_display ();
5590    rl_display_prompt = oldp;
5591    local_prompt = oldl;
5592    local_prompt_prefix = oldlprefix;
5593 -  visible_length = oldlen;
5594 -  prefix_length = oldplen;
5595 -  last_invisible = oldlast;
5596 +  prompt_visible_length = oldlen;
5597 +  prompt_prefix_length = oldplen;
5598 +  prompt_last_invisible = oldlast;
5599 +  prompt_invis_chars_first_line = oldninvis;
5601        
5602  /* Redisplay the current line after a SIGWINCH is received. */
5603 @@ -1642,31 +1752,35 @@ _rl_redisplay_after_sigwinch ()
5605    /* Clear the current line and put the cursor at column 0.  Make sure
5606       the right thing happens if we have wrapped to a new screen line. */
5607 -  if (term_cr)
5608 +  if (_rl_term_cr)
5609      {
5610 -#if defined (__MSDOS__)
5611 +#ifdef __MINGW32__
5612 +      _rl_move_cursor_relative (0, 0);
5613 +      space_to_eol (_rl_screenwidth);
5614 +      _rl_move_cursor_relative (0, 0);
5615 +#elif defined (__MSDOS__)
5616        putc ('\r', rl_outstream);
5617  #else
5618 -      tputs (term_cr, 1, _rl_output_character_function);
5619 +      tputs (_rl_term_cr, 1, _rl_output_character_function);
5620  #endif
5621        _rl_last_c_pos = 0;
5622  #if defined (__MSDOS__)
5623 -      space_to_eol (screenwidth);
5624 +      space_to_eol (_rl_screenwidth);
5625        putc ('\r', rl_outstream);
5626 -#else
5627 -      if (term_clreol)
5628 -       tputs (term_clreol, 1, _rl_output_character_function);
5629 +#elif !defined (__MINGW32__)
5630 +      if (_rl_term_clreol)
5631 +       tputs (_rl_term_clreol, 1, _rl_output_character_function);
5632        else
5633         {
5634 -         space_to_eol (screenwidth);
5635 -         tputs (term_cr, 1, _rl_output_character_function);
5636 +         space_to_eol (_rl_screenwidth);
5637 +         tputs (_rl_term_cr, 1, _rl_output_character_function);
5638         }
5639  #endif
5640        if (_rl_last_v_pos > 0)
5641         _rl_move_vert (0);
5642      }
5643    else
5644 -    crlf ();
5645 +    rl_crlf ();
5647    /* Redraw only the last line of a multi-line prompt. */
5648    t = strrchr (rl_display_prompt, '\n');
5649 @@ -1707,12 +1821,12 @@ _rl_current_display_line ()
5650    /* Find out whether or not there might be invisible characters in the
5651       editing buffer. */
5652    if (rl_display_prompt == rl_prompt)
5653 -    nleft = _rl_last_c_pos - screenwidth - rl_visible_prompt_length;
5654 +    nleft = _rl_last_c_pos - _rl_screenwidth - rl_visible_prompt_length;
5655    else
5656 -    nleft = _rl_last_c_pos - screenwidth;
5657 +    nleft = _rl_last_c_pos - _rl_screenwidth;
5659    if (nleft > 0)
5660 -    ret = 1 + nleft / screenwidth;
5661 +    ret = 1 + nleft / _rl_screenwidth;
5662    else
5663      ret = 0;
5665 Index: readline/emacs_keymap.c
5666 ===================================================================
5667 RCS file: /prjz/.cvsroot/gdb/readline/emacs_keymap.c,v
5668 retrieving revision 1.1.1.1
5669 diff -u -3 -p -r1.1.1.1 emacs_keymap.c
5670 --- readline/emacs_keymap.c     2003/02/16 21:36:30     1.1.1.1
5671 +++ readline/emacs_keymap.c     2000/10/30 17:01:50
5672 @@ -33,185 +33,185 @@
5673  KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
5675    /* Control keys. */
5676 -  { ISFUNC, rl_set_mark },             /* Control-@ */
5677 -  { ISFUNC, rl_beg_of_line },          /* Control-a */
5678 -  { ISFUNC, rl_backward },             /* Control-b */
5679 -  { ISFUNC, (Function *)0x0 },         /* Control-c */
5680 -  { ISFUNC, rl_delete },               /* Control-d */
5681 -  { ISFUNC, rl_end_of_line },          /* Control-e */
5682 -  { ISFUNC, rl_forward },              /* Control-f */
5683 -  { ISFUNC, rl_abort },                        /* Control-g */
5684 -  { ISFUNC, rl_rubout },               /* Control-h */
5685 -  { ISFUNC, rl_complete },             /* Control-i */
5686 -  { ISFUNC, rl_newline },              /* Control-j */
5687 -  { ISFUNC, rl_kill_line },            /* Control-k */
5688 -  { ISFUNC, rl_clear_screen },         /* Control-l */
5689 -  { ISFUNC, rl_newline },              /* Control-m */
5690 -  { ISFUNC, rl_get_next_history },     /* Control-n */
5691 -  { ISFUNC, (Function *)0x0 },         /* Control-o */
5692 -  { ISFUNC, rl_get_previous_history }, /* Control-p */
5693 -  { ISFUNC, rl_quoted_insert },                /* Control-q */
5694 -  { ISFUNC, rl_reverse_search_history }, /* Control-r */
5695 -  { ISFUNC, rl_forward_search_history }, /* Control-s */
5696 -  { ISFUNC, rl_transpose_chars },      /* Control-t */
5697 -  { ISFUNC, rl_unix_line_discard },    /* Control-u */
5698 -  { ISFUNC, rl_quoted_insert },                /* Control-v */
5699 -  { ISFUNC, rl_unix_word_rubout },     /* Control-w */
5700 -  { ISKMAP, (Function *)emacs_ctlx_keymap },   /* Control-x */
5701 -  { ISFUNC, rl_yank },                 /* Control-y */
5702 -  { ISFUNC, (Function *)0x0 },         /* Control-z */
5703 -  { ISKMAP, (Function *)emacs_meta_keymap }, /* Control-[ */
5704 -  { ISFUNC, (Function *)0x0 },         /* Control-\ */
5705 -  { ISFUNC, rl_char_search },          /* Control-] */
5706 -  { ISFUNC, (Function *)0x0 },         /* Control-^ */
5707 -  { ISFUNC, rl_undo_command },         /* Control-_ */
5708 +  { ISFUNC, rl_set_mark },                     /* Control-@ */
5709 +  { ISFUNC, rl_beg_of_line },                  /* Control-a */
5710 +  { ISFUNC, rl_backward },                     /* Control-b */
5711 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-c */
5712 +  { ISFUNC, rl_delete },                       /* Control-d */
5713 +  { ISFUNC, rl_end_of_line },                  /* Control-e */
5714 +  { ISFUNC, rl_forward },                      /* Control-f */
5715 +  { ISFUNC, rl_abort },                                /* Control-g */
5716 +  { ISFUNC, rl_rubout },                       /* Control-h */
5717 +  { ISFUNC, rl_complete },                     /* Control-i */
5718 +  { ISFUNC, rl_newline },                      /* Control-j */
5719 +  { ISFUNC, rl_kill_line },                    /* Control-k */
5720 +  { ISFUNC, rl_clear_screen },                 /* Control-l */
5721 +  { ISFUNC, rl_newline },                      /* Control-m */
5722 +  { ISFUNC, rl_get_next_history },             /* Control-n */
5723 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-o */
5724 +  { ISFUNC, rl_get_previous_history },         /* Control-p */
5725 +  { ISFUNC, rl_quoted_insert },                        /* Control-q */
5726 +  { ISFUNC, rl_reverse_search_history },       /* Control-r */
5727 +  { ISFUNC, rl_forward_search_history },       /* Control-s */
5728 +  { ISFUNC, rl_transpose_chars },              /* Control-t */
5729 +  { ISFUNC, rl_unix_line_discard },            /* Control-u */
5730 +  { ISFUNC, rl_quoted_insert },                        /* Control-v */
5731 +  { ISFUNC, rl_unix_word_rubout },             /* Control-w */
5732 +  { ISKMAP, (rl_command_func_t *)emacs_ctlx_keymap },  /* Control-x */
5733 +  { ISFUNC, rl_yank },                         /* Control-y */
5734 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-z */
5735 +  { ISKMAP, (rl_command_func_t *)emacs_meta_keymap }, /* Control-[ */
5736 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-\ */
5737 +  { ISFUNC, rl_char_search },                  /* Control-] */
5738 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-^ */
5739 +  { ISFUNC, rl_undo_command },                 /* Control-_ */
5741    /* The start of printing characters. */
5742 -  { ISFUNC, rl_insert },       /* SPACE */
5743 -  { ISFUNC, rl_insert },       /* ! */
5744 -  { ISFUNC, rl_insert },       /* " */
5745 -  { ISFUNC, rl_insert },       /* # */
5746 -  { ISFUNC, rl_insert },       /* $ */
5747 -  { ISFUNC, rl_insert },       /* % */
5748 -  { ISFUNC, rl_insert },       /* & */
5749 -  { ISFUNC, rl_insert },       /* ' */
5750 -  { ISFUNC, rl_insert },       /* ( */
5751 -  { ISFUNC, rl_insert },       /* ) */
5752 -  { ISFUNC, rl_insert },       /* * */
5753 -  { ISFUNC, rl_insert },       /* + */
5754 -  { ISFUNC, rl_insert },       /* , */
5755 -  { ISFUNC, rl_insert },       /* - */
5756 -  { ISFUNC, rl_insert },       /* . */
5757 -  { ISFUNC, rl_insert },       /* / */
5758 +  { ISFUNC, rl_insert },               /* SPACE */
5759 +  { ISFUNC, rl_insert },               /* ! */
5760 +  { ISFUNC, rl_insert },               /* " */
5761 +  { ISFUNC, rl_insert },               /* # */
5762 +  { ISFUNC, rl_insert },               /* $ */
5763 +  { ISFUNC, rl_insert },               /* % */
5764 +  { ISFUNC, rl_insert },               /* & */
5765 +  { ISFUNC, rl_insert },               /* ' */
5766 +  { ISFUNC, rl_insert },               /* ( */
5767 +  { ISFUNC, rl_insert },               /* ) */
5768 +  { ISFUNC, rl_insert },               /* * */
5769 +  { ISFUNC, rl_insert },               /* + */
5770 +  { ISFUNC, rl_insert },               /* , */
5771 +  { ISFUNC, rl_insert },               /* - */
5772 +  { ISFUNC, rl_insert },               /* . */
5773 +  { ISFUNC, rl_insert },               /* / */
5774 +       
5775 +         /* Regular digits. */
5776 +  { ISFUNC, rl_insert },               /* 0 */
5777 +  { ISFUNC, rl_insert },               /* 1 */
5778 +  { ISFUNC, rl_insert },               /* 2 */
5779 +  { ISFUNC, rl_insert },               /* 3 */
5780 +  { ISFUNC, rl_insert },               /* 4 */
5781 +  { ISFUNC, rl_insert },               /* 5 */
5782 +  { ISFUNC, rl_insert },               /* 6 */
5783 +  { ISFUNC, rl_insert },               /* 7 */
5784 +  { ISFUNC, rl_insert },               /* 8 */
5785 +  { ISFUNC, rl_insert },               /* 9 */
5787 -  /* Regular digits. */
5788 -  { ISFUNC, rl_insert },       /* 0 */
5789 -  { ISFUNC, rl_insert },       /* 1 */
5790 -  { ISFUNC, rl_insert },       /* 2 */
5791 -  { ISFUNC, rl_insert },       /* 3 */
5792 -  { ISFUNC, rl_insert },       /* 4 */
5793 -  { ISFUNC, rl_insert },       /* 5 */
5794 -  { ISFUNC, rl_insert },       /* 6 */
5795 -  { ISFUNC, rl_insert },       /* 7 */
5796 -  { ISFUNC, rl_insert },       /* 8 */
5797 -  { ISFUNC, rl_insert },       /* 9 */
5799    /* A little more punctuation. */
5800 -  { ISFUNC, rl_insert },       /* : */
5801 -  { ISFUNC, rl_insert },       /* ; */
5802 -  { ISFUNC, rl_insert },       /* < */
5803 -  { ISFUNC, rl_insert },       /* = */
5804 -  { ISFUNC, rl_insert },       /* > */
5805 -  { ISFUNC, rl_insert },       /* ? */
5806 -  { ISFUNC, rl_insert },       /* @ */
5807 +  { ISFUNC, rl_insert },               /* : */
5808 +  { ISFUNC, rl_insert },               /* ; */
5809 +  { ISFUNC, rl_insert },               /* < */
5810 +  { ISFUNC, rl_insert },               /* = */
5811 +  { ISFUNC, rl_insert },               /* > */
5812 +  { ISFUNC, rl_insert },               /* ? */
5813 +  { ISFUNC, rl_insert },               /* @ */
5815    /* Uppercase alphabet. */
5816 -  { ISFUNC, rl_insert },       /* A */
5817 -  { ISFUNC, rl_insert },       /* B */
5818 -  { ISFUNC, rl_insert },       /* C */
5819 -  { ISFUNC, rl_insert },       /* D */
5820 -  { ISFUNC, rl_insert },       /* E */
5821 -  { ISFUNC, rl_insert },       /* F */
5822 -  { ISFUNC, rl_insert },       /* G */
5823 -  { ISFUNC, rl_insert },       /* H */
5824 -  { ISFUNC, rl_insert },       /* I */
5825 -  { ISFUNC, rl_insert },       /* J */
5826 -  { ISFUNC, rl_insert },       /* K */
5827 -  { ISFUNC, rl_insert },       /* L */
5828 -  { ISFUNC, rl_insert },       /* M */
5829 -  { ISFUNC, rl_insert },       /* N */
5830 -  { ISFUNC, rl_insert },       /* O */
5831 -  { ISFUNC, rl_insert },       /* P */
5832 -  { ISFUNC, rl_insert },       /* Q */
5833 -  { ISFUNC, rl_insert },       /* R */
5834 -  { ISFUNC, rl_insert },       /* S */
5835 -  { ISFUNC, rl_insert },       /* T */
5836 -  { ISFUNC, rl_insert },       /* U */
5837 -  { ISFUNC, rl_insert },       /* V */
5838 -  { ISFUNC, rl_insert },       /* W */
5839 -  { ISFUNC, rl_insert },       /* X */
5840 -  { ISFUNC, rl_insert },       /* Y */
5841 -  { ISFUNC, rl_insert },       /* Z */
5842 +  { ISFUNC, rl_insert },               /* A */
5843 +  { ISFUNC, rl_insert },               /* B */
5844 +  { ISFUNC, rl_insert },               /* C */
5845 +  { ISFUNC, rl_insert },               /* D */
5846 +  { ISFUNC, rl_insert },               /* E */
5847 +  { ISFUNC, rl_insert },               /* F */
5848 +  { ISFUNC, rl_insert },               /* G */
5849 +  { ISFUNC, rl_insert },               /* H */
5850 +  { ISFUNC, rl_insert },               /* I */
5851 +  { ISFUNC, rl_insert },               /* J */
5852 +  { ISFUNC, rl_insert },               /* K */
5853 +  { ISFUNC, rl_insert },               /* L */
5854 +  { ISFUNC, rl_insert },               /* M */
5855 +  { ISFUNC, rl_insert },               /* N */
5856 +  { ISFUNC, rl_insert },               /* O */
5857 +  { ISFUNC, rl_insert },               /* P */
5858 +  { ISFUNC, rl_insert },               /* Q */
5859 +  { ISFUNC, rl_insert },               /* R */
5860 +  { ISFUNC, rl_insert },               /* S */
5861 +  { ISFUNC, rl_insert },               /* T */
5862 +  { ISFUNC, rl_insert },               /* U */
5863 +  { ISFUNC, rl_insert },               /* V */
5864 +  { ISFUNC, rl_insert },               /* W */
5865 +  { ISFUNC, rl_insert },               /* X */
5866 +  { ISFUNC, rl_insert },               /* Y */
5867 +  { ISFUNC, rl_insert },               /* Z */
5869    /* Some more punctuation. */
5870 -  { ISFUNC, rl_insert },       /* [ */
5871 -  { ISFUNC, rl_insert },       /* \ */
5872 -  { ISFUNC, rl_insert },       /* ] */
5873 -  { ISFUNC, rl_insert },       /* ^ */
5874 -  { ISFUNC, rl_insert },       /* _ */
5875 -  { ISFUNC, rl_insert },       /* ` */
5876 +  { ISFUNC, rl_insert },               /* [ */
5877 +  { ISFUNC, rl_insert },               /* \ */
5878 +  { ISFUNC, rl_insert },               /* ] */
5879 +  { ISFUNC, rl_insert },               /* ^ */
5880 +  { ISFUNC, rl_insert },               /* _ */
5881 +  { ISFUNC, rl_insert },               /* ` */
5883    /* Lowercase alphabet. */
5884 -  { ISFUNC, rl_insert },       /* a */
5885 -  { ISFUNC, rl_insert },       /* b */
5886 -  { ISFUNC, rl_insert },       /* c */
5887 -  { ISFUNC, rl_insert },       /* d */
5888 -  { ISFUNC, rl_insert },       /* e */
5889 -  { ISFUNC, rl_insert },       /* f */
5890 -  { ISFUNC, rl_insert },       /* g */
5891 -  { ISFUNC, rl_insert },       /* h */
5892 -  { ISFUNC, rl_insert },       /* i */
5893 -  { ISFUNC, rl_insert },       /* j */
5894 -  { ISFUNC, rl_insert },       /* k */
5895 -  { ISFUNC, rl_insert },       /* l */
5896 -  { ISFUNC, rl_insert },       /* m */
5897 -  { ISFUNC, rl_insert },       /* n */
5898 -  { ISFUNC, rl_insert },       /* o */
5899 -  { ISFUNC, rl_insert },       /* p */
5900 -  { ISFUNC, rl_insert },       /* q */
5901 -  { ISFUNC, rl_insert },       /* r */
5902 -  { ISFUNC, rl_insert },       /* s */
5903 -  { ISFUNC, rl_insert },       /* t */
5904 -  { ISFUNC, rl_insert },       /* u */
5905 -  { ISFUNC, rl_insert },       /* v */
5906 -  { ISFUNC, rl_insert },       /* w */
5907 -  { ISFUNC, rl_insert },       /* x */
5908 -  { ISFUNC, rl_insert },       /* y */
5909 -  { ISFUNC, rl_insert },       /* z */
5910 +  { ISFUNC, rl_insert },               /* a */
5911 +  { ISFUNC, rl_insert },               /* b */
5912 +  { ISFUNC, rl_insert },               /* c */
5913 +  { ISFUNC, rl_insert },               /* d */
5914 +  { ISFUNC, rl_insert },               /* e */
5915 +  { ISFUNC, rl_insert },               /* f */
5916 +  { ISFUNC, rl_insert },               /* g */
5917 +  { ISFUNC, rl_insert },               /* h */
5918 +  { ISFUNC, rl_insert },               /* i */
5919 +  { ISFUNC, rl_insert },               /* j */
5920 +  { ISFUNC, rl_insert },               /* k */
5921 +  { ISFUNC, rl_insert },               /* l */
5922 +  { ISFUNC, rl_insert },               /* m */
5923 +  { ISFUNC, rl_insert },               /* n */
5924 +  { ISFUNC, rl_insert },               /* o */
5925 +  { ISFUNC, rl_insert },               /* p */
5926 +  { ISFUNC, rl_insert },               /* q */
5927 +  { ISFUNC, rl_insert },               /* r */
5928 +  { ISFUNC, rl_insert },               /* s */
5929 +  { ISFUNC, rl_insert },               /* t */
5930 +  { ISFUNC, rl_insert },               /* u */
5931 +  { ISFUNC, rl_insert },               /* v */
5932 +  { ISFUNC, rl_insert },               /* w */
5933 +  { ISFUNC, rl_insert },               /* x */
5934 +  { ISFUNC, rl_insert },               /* y */
5935 +  { ISFUNC, rl_insert },               /* z */
5937    /* Final punctuation. */
5938 -  { ISFUNC, rl_insert },       /* { */
5939 -  { ISFUNC, rl_insert },       /* | */
5940 -  { ISFUNC, rl_insert },       /* } */
5941 -  { ISFUNC, rl_insert },       /* ~ */
5942 -  { ISFUNC, rl_rubout },       /* RUBOUT */
5943 +  { ISFUNC, rl_insert },               /* { */
5944 +  { ISFUNC, rl_insert },               /* | */
5945 +  { ISFUNC, rl_insert },               /* } */
5946 +  { ISFUNC, rl_insert },               /* ~ */
5947 +  { ISFUNC, rl_rubout },               /* RUBOUT */
5949  #if KEYMAP_SIZE > 128
5950    /* Pure 8-bit characters (128 - 159).
5951       These might be used in some
5952       character sets. */
5953 -  { ISFUNC, rl_insert },       /* ? */
5954 -  { ISFUNC, rl_insert },       /* ? */
5955 -  { ISFUNC, rl_insert },       /* ? */
5956 -  { ISFUNC, rl_insert },       /* ? */
5957 -  { ISFUNC, rl_insert },       /* ? */
5958 -  { ISFUNC, rl_insert },       /* ? */
5959 -  { ISFUNC, rl_insert },       /* ? */
5960 -  { ISFUNC, rl_insert },       /* ? */
5961 -  { ISFUNC, rl_insert },       /* ? */
5962 -  { ISFUNC, rl_insert },       /* ? */
5963 -  { ISFUNC, rl_insert },       /* ? */
5964 -  { ISFUNC, rl_insert },       /* ? */
5965 -  { ISFUNC, rl_insert },       /* ? */
5966 -  { ISFUNC, rl_insert },       /* ? */
5967 -  { ISFUNC, rl_insert },       /* ? */
5968 -  { ISFUNC, rl_insert },       /* ? */
5969 -  { ISFUNC, rl_insert },       /* ? */
5970 -  { ISFUNC, rl_insert },       /* ? */
5971 -  { ISFUNC, rl_insert },       /* ? */
5972 -  { ISFUNC, rl_insert },       /* ? */
5973 -  { ISFUNC, rl_insert },       /* ? */
5974 -  { ISFUNC, rl_insert },       /* ? */
5975 -  { ISFUNC, rl_insert },       /* ? */
5976 -  { ISFUNC, rl_insert },       /* ? */
5977 -  { ISFUNC, rl_insert },       /* ? */
5978 -  { ISFUNC, rl_insert },       /* ? */
5979 -  { ISFUNC, rl_insert },       /* ? */
5980 -  { ISFUNC, rl_insert },       /* ? */
5981 -  { ISFUNC, rl_insert },       /* ? */
5982 -  { ISFUNC, rl_insert },       /* ? */
5983 -  { ISFUNC, rl_insert },       /* ? */
5984 -  { ISFUNC, rl_insert },       /* ? */
5985 +  { ISFUNC, rl_insert },               /* ? */
5986 +  { ISFUNC, rl_insert },               /* ? */
5987 +  { ISFUNC, rl_insert },               /* ? */
5988 +  { ISFUNC, rl_insert },               /* ? */
5989 +  { ISFUNC, rl_insert },               /* ? */
5990 +  { ISFUNC, rl_insert },               /* ? */
5991 +  { ISFUNC, rl_insert },               /* ? */
5992 +  { ISFUNC, rl_insert },               /* ? */
5993 +  { ISFUNC, rl_insert },               /* ? */
5994 +  { ISFUNC, rl_insert },               /* ? */
5995 +  { ISFUNC, rl_insert },               /* ? */
5996 +  { ISFUNC, rl_insert },               /* ? */
5997 +  { ISFUNC, rl_insert },               /* ? */
5998 +  { ISFUNC, rl_insert },               /* ? */
5999 +  { ISFUNC, rl_insert },               /* ? */
6000 +  { ISFUNC, rl_insert },               /* ? */
6001 +  { ISFUNC, rl_insert },               /* ? */
6002 +  { ISFUNC, rl_insert },               /* ? */
6003 +  { ISFUNC, rl_insert },               /* ? */
6004 +  { ISFUNC, rl_insert },               /* ? */
6005 +  { ISFUNC, rl_insert },               /* ? */
6006 +  { ISFUNC, rl_insert },               /* ? */
6007 +  { ISFUNC, rl_insert },               /* ? */
6008 +  { ISFUNC, rl_insert },               /* ? */
6009 +  { ISFUNC, rl_insert },               /* ? */
6010 +  { ISFUNC, rl_insert },               /* ? */
6011 +  { ISFUNC, rl_insert },               /* ? */
6012 +  { ISFUNC, rl_insert },               /* ? */
6013 +  { ISFUNC, rl_insert },               /* ? */
6014 +  { ISFUNC, rl_insert },               /* ? */
6015 +  { ISFUNC, rl_insert },               /* ? */
6016 +  { ISFUNC, rl_insert },               /* ? */
6018    /* ISO Latin-1 characters (160 - 255) */
6019    { ISFUNC, rl_insert },       /* No-break space */
6020 @@ -316,78 +316,78 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap
6021  KEYMAP_ENTRY_ARRAY emacs_meta_keymap = {
6023    /* Meta keys.  Just like above, but the high bit is set. */
6024 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-@ */
6025 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-a */
6026 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-b */
6027 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-c */
6028 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-d */
6029 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-e */
6030 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-f */
6031 -  { ISFUNC, rl_abort },                /* Meta-Control-g */
6032 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-@ */
6033 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-a */
6034 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-b */
6035 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-c */
6036 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-d */
6037 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-e */
6038 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-f */
6039 +  { ISFUNC, rl_abort },                        /* Meta-Control-g */
6040    { ISFUNC, rl_backward_kill_word },   /* Meta-Control-h */
6041 -  { ISFUNC, rl_tab_insert },   /* Meta-Control-i */
6042 -  { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-j */
6043 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-k */
6044 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-l */
6045 -  { ISFUNC, rl_vi_editing_mode }, /* Meta-Control-m */
6046 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-n */
6047 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-o */
6048 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-p */
6049 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-q */
6050 -  { ISFUNC, rl_revert_line },  /* Meta-Control-r */
6051 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-s */
6052 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-t */
6053 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-u */
6054 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-v */
6055 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-w */
6056 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-x */
6057 -  { ISFUNC, rl_yank_nth_arg }, /* Meta-Control-y */
6058 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-z */
6059 +  { ISFUNC, rl_tab_insert },           /* Meta-Control-i */
6060 +  { ISFUNC, rl_vi_editing_mode },      /* Meta-Control-j */
6061 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-k */
6062 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-l */
6063 +  { ISFUNC, rl_vi_editing_mode },      /* Meta-Control-m */
6064 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-n */
6065 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-o */
6066 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-p */
6067 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-q */
6068 +  { ISFUNC, rl_revert_line },          /* Meta-Control-r */
6069 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-s */
6070 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-t */
6071 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-u */
6072 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-v */
6073 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-w */
6074 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-x */
6075 +  { ISFUNC, rl_yank_nth_arg },         /* Meta-Control-y */
6076 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-z */
6078 -  { ISFUNC, rl_complete },     /* Meta-Control-[ */
6079 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-\ */
6080 +  { ISFUNC, rl_complete },             /* Meta-Control-[ */
6081 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-\ */
6082    { ISFUNC, rl_backward_char_search }, /* Meta-Control-] */
6083 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-^ */
6084 -  { ISFUNC, (Function *)0x0 }, /* Meta-Control-_ */
6085 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-^ */
6086 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-Control-_ */
6088    /* The start of printing characters. */
6089 -  { ISFUNC, rl_set_mark },     /* Meta-SPACE */
6090 -  { ISFUNC, (Function *)0x0 }, /* Meta-! */
6091 -  { ISFUNC, (Function *)0x0 }, /* Meta-" */
6092 -  { ISFUNC, rl_insert_comment },/* Meta-# */
6093 -  { ISFUNC, (Function *)0x0 }, /* Meta-$ */
6094 -  { ISFUNC, (Function *)0x0 }, /* Meta-% */
6095 -  { ISFUNC, rl_tilde_expand }, /* Meta-& */
6096 -  { ISFUNC, (Function *)0x0 }, /* Meta-' */
6097 -  { ISFUNC, (Function *)0x0 }, /* Meta-( */
6098 -  { ISFUNC, (Function *)0x0 }, /* Meta-) */
6099 +  { ISFUNC, rl_set_mark },             /* Meta-SPACE */
6100 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-! */
6101 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-" */
6102 +  { ISFUNC, rl_insert_comment },       /* Meta-# */
6103 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-$ */
6104 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-% */
6105 +  { ISFUNC, rl_tilde_expand },         /* Meta-& */
6106 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-' */
6107 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-( */
6108 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-) */
6109    { ISFUNC, rl_insert_completions },   /* Meta-* */
6110 -  { ISFUNC, (Function *)0x0 }, /* Meta-+ */
6111 -  { ISFUNC, (Function *)0x0 }, /* Meta-, */
6112 -  { ISFUNC, rl_digit_argument }, /* Meta-- */
6113 -  { ISFUNC, rl_yank_last_arg}, /* Meta-. */
6114 -  { ISFUNC, (Function *)0x0 }, /* Meta-/ */
6115 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-+ */
6116 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-, */
6117 +  { ISFUNC, rl_digit_argument },       /* Meta-- */
6118 +  { ISFUNC, rl_yank_last_arg},         /* Meta-. */
6119 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-/ */
6121    /* Regular digits. */
6122 -  { ISFUNC, rl_digit_argument }, /* Meta-0 */
6123 -  { ISFUNC, rl_digit_argument }, /* Meta-1 */
6124 -  { ISFUNC, rl_digit_argument }, /* Meta-2 */
6125 -  { ISFUNC, rl_digit_argument }, /* Meta-3 */
6126 -  { ISFUNC, rl_digit_argument }, /* Meta-4 */
6127 -  { ISFUNC, rl_digit_argument }, /* Meta-5 */
6128 -  { ISFUNC, rl_digit_argument }, /* Meta-6 */
6129 -  { ISFUNC, rl_digit_argument }, /* Meta-7 */
6130 -  { ISFUNC, rl_digit_argument }, /* Meta-8 */
6131 -  { ISFUNC, rl_digit_argument }, /* Meta-9 */
6132 +  { ISFUNC, rl_digit_argument },       /* Meta-0 */
6133 +  { ISFUNC, rl_digit_argument },       /* Meta-1 */
6134 +  { ISFUNC, rl_digit_argument },       /* Meta-2 */
6135 +  { ISFUNC, rl_digit_argument },       /* Meta-3 */
6136 +  { ISFUNC, rl_digit_argument },       /* Meta-4 */
6137 +  { ISFUNC, rl_digit_argument },       /* Meta-5 */
6138 +  { ISFUNC, rl_digit_argument },       /* Meta-6 */
6139 +  { ISFUNC, rl_digit_argument },       /* Meta-7 */
6140 +  { ISFUNC, rl_digit_argument },       /* Meta-8 */
6141 +  { ISFUNC, rl_digit_argument },       /* Meta-9 */
6143    /* A little more punctuation. */
6144 -  { ISFUNC, (Function *)0x0 },         /* Meta-: */
6145 -  { ISFUNC, (Function *)0x0 },         /* Meta-; */
6146 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-: */
6147 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-; */
6148    { ISFUNC, rl_beginning_of_history }, /* Meta-< */
6149    { ISFUNC, rl_possible_completions }, /* Meta-= */
6150    { ISFUNC, rl_end_of_history },       /* Meta-> */
6151    { ISFUNC, rl_possible_completions }, /* Meta-? */
6152 -  { ISFUNC, (Function *)0x0 },         /* Meta-@ */
6153 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-@ */
6155    /* Uppercase alphabet. */
6156    { ISFUNC, rl_do_lowercase_version }, /* Meta-A */
6157 @@ -418,456 +418,456 @@ KEYMAP_ENTRY_ARRAY emacs_meta_keymap = {
6158    { ISFUNC, rl_do_lowercase_version }, /* Meta-Z */
6160    /* Some more punctuation. */
6161 -  { ISFUNC, (Function *)0x0 },         /* Meta-[ */    /* was rl_arrow_keys */
6162 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Meta-[ */    /* was rl_arrow_keys */
6163    { ISFUNC, rl_delete_horizontal_space },      /* Meta-\ */
6164 -  { ISFUNC, (Function *)0x0 },         /* Meta-] */
6165 -  { ISFUNC, (Function *)0x0 },         /* Meta-^ */
6166 -  { ISFUNC, rl_yank_last_arg },                /* Meta-_ */
6167 -  { ISFUNC, (Function *)0x0 },         /* Meta-` */
6168 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Meta-] */
6169 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Meta-^ */
6170 +  { ISFUNC, rl_yank_last_arg },                        /* Meta-_ */
6171 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Meta-` */
6173    /* Lowercase alphabet. */
6174 -  { ISFUNC, (Function *)0x0 }, /* Meta-a */
6175 -  { ISFUNC, rl_backward_word },        /* Meta-b */
6176 -  { ISFUNC, rl_capitalize_word }, /* Meta-c */
6177 -  { ISFUNC, rl_kill_word },    /* Meta-d */
6178 -  { ISFUNC, (Function *)0x0 }, /* Meta-e */
6179 -  { ISFUNC, rl_forward_word }, /* Meta-f */
6180 -  { ISFUNC, (Function *)0x0 }, /* Meta-g */
6181 -  { ISFUNC, (Function *)0x0 }, /* Meta-h */
6182 -  { ISFUNC, (Function *)0x0 }, /* Meta-i */
6183 -  { ISFUNC, (Function *)0x0 }, /* Meta-j */
6184 -  { ISFUNC, (Function *)0x0 }, /* Meta-k */
6185 -  { ISFUNC, rl_downcase_word },        /* Meta-l */
6186 -  { ISFUNC, (Function *)0x0 }, /* Meta-m */
6187 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-a */
6188 +  { ISFUNC, rl_backward_word },                /* Meta-b */
6189 +  { ISFUNC, rl_capitalize_word },      /* Meta-c */
6190 +  { ISFUNC, rl_kill_word },            /* Meta-d */
6191 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-e */
6192 +  { ISFUNC, rl_forward_word },         /* Meta-f */
6193 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-g */
6194 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-h */
6195 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-i */
6196 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-j */
6197 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-k */
6198 +  { ISFUNC, rl_downcase_word },                /* Meta-l */
6199 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-m */
6200    { ISFUNC, rl_noninc_forward_search },        /* Meta-n */
6201 -  { ISFUNC, (Function *)0x0 }, /* Meta-o */    /* was rl_arrow_keys */
6202 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-o */    /* was rl_arrow_keys */
6203    { ISFUNC, rl_noninc_reverse_search },        /* Meta-p */
6204 -  { ISFUNC, (Function *)0x0 }, /* Meta-q */
6205 -  { ISFUNC, rl_revert_line },  /* Meta-r */
6206 -  { ISFUNC, (Function *)0x0 }, /* Meta-s */
6207 -  { ISFUNC, rl_transpose_words }, /* Meta-t */
6208 -  { ISFUNC, rl_upcase_word },  /* Meta-u */
6209 -  { ISFUNC, (Function *)0x0 }, /* Meta-v */
6210 -  { ISFUNC, (Function *)0x0 }, /* Meta-w */
6211 -  { ISFUNC, (Function *)0x0 }, /* Meta-x */
6212 -  { ISFUNC, rl_yank_pop },     /* Meta-y */
6213 -  { ISFUNC, (Function *)0x0 }, /* Meta-z */
6214 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-q */
6215 +  { ISFUNC, rl_revert_line },          /* Meta-r */
6216 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-s */
6217 +  { ISFUNC, rl_transpose_words },      /* Meta-t */
6218 +  { ISFUNC, rl_upcase_word },          /* Meta-u */
6219 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-v */
6220 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-w */
6221 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-x */
6222 +  { ISFUNC, rl_yank_pop },             /* Meta-y */
6223 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-z */
6225    /* Final punctuation. */
6226 -  { ISFUNC, (Function *)0x0 }, /* Meta-{ */
6227 -  { ISFUNC, (Function *)0x0 }, /* Meta-| */
6228 -  { ISFUNC, (Function *)0x0 }, /* Meta-} */
6229 -  { ISFUNC, rl_tilde_expand }, /* Meta-~ */
6230 -  { ISFUNC, rl_backward_kill_word }, /* Meta-rubout */
6231 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-{ */
6232 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-| */
6233 +  { ISFUNC, (rl_command_func_t *)0x0 },        /* Meta-} */
6234 +  { ISFUNC, rl_tilde_expand },         /* Meta-~ */
6235 +  { ISFUNC, rl_backward_kill_word },   /* Meta-rubout */
6237  #if KEYMAP_SIZE > 128
6238    /* Undefined keys. */
6239 -  { ISFUNC, (Function *)0x0 },
6240 -  { ISFUNC, (Function *)0x0 },
6241 -  { ISFUNC, (Function *)0x0 },
6242 -  { ISFUNC, (Function *)0x0 },
6243 -  { ISFUNC, (Function *)0x0 },
6244 -  { ISFUNC, (Function *)0x0 },
6245 -  { ISFUNC, (Function *)0x0 },
6246 -  { ISFUNC, (Function *)0x0 },
6247 -  { ISFUNC, (Function *)0x0 },
6248 -  { ISFUNC, (Function *)0x0 },
6249 -  { ISFUNC, (Function *)0x0 },
6250 -  { ISFUNC, (Function *)0x0 },
6251 -  { ISFUNC, (Function *)0x0 },
6252 -  { ISFUNC, (Function *)0x0 },
6253 -  { ISFUNC, (Function *)0x0 },
6254 -  { ISFUNC, (Function *)0x0 },
6255 -  { ISFUNC, (Function *)0x0 },
6256 -  { ISFUNC, (Function *)0x0 },
6257 -  { ISFUNC, (Function *)0x0 },
6258 -  { ISFUNC, (Function *)0x0 },
6259 -  { ISFUNC, (Function *)0x0 },
6260 -  { ISFUNC, (Function *)0x0 },
6261 -  { ISFUNC, (Function *)0x0 },
6262 -  { ISFUNC, (Function *)0x0 },
6263 -  { ISFUNC, (Function *)0x0 },
6264 -  { ISFUNC, (Function *)0x0 },
6265 -  { ISFUNC, (Function *)0x0 },
6266 -  { ISFUNC, (Function *)0x0 },
6267 -  { ISFUNC, (Function *)0x0 },
6268 -  { ISFUNC, (Function *)0x0 },
6269 -  { ISFUNC, (Function *)0x0 },
6270 -  { ISFUNC, (Function *)0x0 },
6271 -  { ISFUNC, (Function *)0x0 },
6272 -  { ISFUNC, (Function *)0x0 },
6273 -  { ISFUNC, (Function *)0x0 },
6274 -  { ISFUNC, (Function *)0x0 },
6275 -  { ISFUNC, (Function *)0x0 },
6276 -  { ISFUNC, (Function *)0x0 },
6277 -  { ISFUNC, (Function *)0x0 },
6278 -  { ISFUNC, (Function *)0x0 },
6279 -  { ISFUNC, (Function *)0x0 },
6280 -  { ISFUNC, (Function *)0x0 },
6281 -  { ISFUNC, (Function *)0x0 },
6282 -  { ISFUNC, (Function *)0x0 },
6283 -  { ISFUNC, (Function *)0x0 },
6284 -  { ISFUNC, (Function *)0x0 },
6285 -  { ISFUNC, (Function *)0x0 },
6286 -  { ISFUNC, (Function *)0x0 },
6287 -  { ISFUNC, (Function *)0x0 },
6288 -  { ISFUNC, (Function *)0x0 },
6289 -  { ISFUNC, (Function *)0x0 },
6290 -  { ISFUNC, (Function *)0x0 },
6291 -  { ISFUNC, (Function *)0x0 },
6292 -  { ISFUNC, (Function *)0x0 },
6293 -  { ISFUNC, (Function *)0x0 },
6294 -  { ISFUNC, (Function *)0x0 },
6295 -  { ISFUNC, (Function *)0x0 },
6296 -  { ISFUNC, (Function *)0x0 },
6297 -  { ISFUNC, (Function *)0x0 },
6298 -  { ISFUNC, (Function *)0x0 },
6299 -  { ISFUNC, (Function *)0x0 },
6300 -  { ISFUNC, (Function *)0x0 },
6301 -  { ISFUNC, (Function *)0x0 },
6302 -  { ISFUNC, (Function *)0x0 },
6303 -  { ISFUNC, (Function *)0x0 },
6304 -  { ISFUNC, (Function *)0x0 },
6305 -  { ISFUNC, (Function *)0x0 },
6306 -  { ISFUNC, (Function *)0x0 },
6307 -  { ISFUNC, (Function *)0x0 },
6308 -  { ISFUNC, (Function *)0x0 },
6309 -  { ISFUNC, (Function *)0x0 },
6310 -  { ISFUNC, (Function *)0x0 },
6311 -  { ISFUNC, (Function *)0x0 },
6312 -  { ISFUNC, (Function *)0x0 },
6313 -  { ISFUNC, (Function *)0x0 },
6314 -  { ISFUNC, (Function *)0x0 },
6315 -  { ISFUNC, (Function *)0x0 },
6316 -  { ISFUNC, (Function *)0x0 },
6317 -  { ISFUNC, (Function *)0x0 },
6318 -  { ISFUNC, (Function *)0x0 },
6319 -  { ISFUNC, (Function *)0x0 },
6320 -  { ISFUNC, (Function *)0x0 },
6321 -  { ISFUNC, (Function *)0x0 },
6322 -  { ISFUNC, (Function *)0x0 },
6323 -  { ISFUNC, (Function *)0x0 },
6324 -  { ISFUNC, (Function *)0x0 },
6325 -  { ISFUNC, (Function *)0x0 },
6326 -  { ISFUNC, (Function *)0x0 },
6327 -  { ISFUNC, (Function *)0x0 },
6328 -  { ISFUNC, (Function *)0x0 },
6329 -  { ISFUNC, (Function *)0x0 },
6330 -  { ISFUNC, (Function *)0x0 },
6331 -  { ISFUNC, (Function *)0x0 },
6332 -  { ISFUNC, (Function *)0x0 },
6333 -  { ISFUNC, (Function *)0x0 },
6334 -  { ISFUNC, (Function *)0x0 },
6335 -  { ISFUNC, (Function *)0x0 },
6336 -  { ISFUNC, (Function *)0x0 },
6337 -  { ISFUNC, (Function *)0x0 },
6338 -  { ISFUNC, (Function *)0x0 },
6339 -  { ISFUNC, (Function *)0x0 },
6340 -  { ISFUNC, (Function *)0x0 },
6341 -  { ISFUNC, (Function *)0x0 },
6342 -  { ISFUNC, (Function *)0x0 },
6343 -  { ISFUNC, (Function *)0x0 },
6344 -  { ISFUNC, (Function *)0x0 },
6345 -  { ISFUNC, (Function *)0x0 },
6346 -  { ISFUNC, (Function *)0x0 },
6347 -  { ISFUNC, (Function *)0x0 },
6348 -  { ISFUNC, (Function *)0x0 },
6349 -  { ISFUNC, (Function *)0x0 },
6350 -  { ISFUNC, (Function *)0x0 },
6351 -  { ISFUNC, (Function *)0x0 },
6352 -  { ISFUNC, (Function *)0x0 },
6353 -  { ISFUNC, (Function *)0x0 },
6354 -  { ISFUNC, (Function *)0x0 },
6355 -  { ISFUNC, (Function *)0x0 },
6356 -  { ISFUNC, (Function *)0x0 },
6357 -  { ISFUNC, (Function *)0x0 },
6358 -  { ISFUNC, (Function *)0x0 },
6359 -  { ISFUNC, (Function *)0x0 },
6360 -  { ISFUNC, (Function *)0x0 },
6361 -  { ISFUNC, (Function *)0x0 },
6362 -  { ISFUNC, (Function *)0x0 },
6363 -  { ISFUNC, (Function *)0x0 },
6364 -  { ISFUNC, (Function *)0x0 },
6365 -  { ISFUNC, (Function *)0x0 },
6366 -  { ISFUNC, (Function *)0x0 }
6367 +  { ISFUNC, (rl_command_func_t *)0x0 },
6368 +  { ISFUNC, (rl_command_func_t *)0x0 },
6369 +  { ISFUNC, (rl_command_func_t *)0x0 },
6370 +  { ISFUNC, (rl_command_func_t *)0x0 },
6371 +  { ISFUNC, (rl_command_func_t *)0x0 },
6372 +  { ISFUNC, (rl_command_func_t *)0x0 },
6373 +  { ISFUNC, (rl_command_func_t *)0x0 },
6374 +  { ISFUNC, (rl_command_func_t *)0x0 },
6375 +  { ISFUNC, (rl_command_func_t *)0x0 },
6376 +  { ISFUNC, (rl_command_func_t *)0x0 },
6377 +  { ISFUNC, (rl_command_func_t *)0x0 },
6378 +  { ISFUNC, (rl_command_func_t *)0x0 },
6379 +  { ISFUNC, (rl_command_func_t *)0x0 },
6380 +  { ISFUNC, (rl_command_func_t *)0x0 },
6381 +  { ISFUNC, (rl_command_func_t *)0x0 },
6382 +  { ISFUNC, (rl_command_func_t *)0x0 },
6383 +  { ISFUNC, (rl_command_func_t *)0x0 },
6384 +  { ISFUNC, (rl_command_func_t *)0x0 },
6385 +  { ISFUNC, (rl_command_func_t *)0x0 },
6386 +  { ISFUNC, (rl_command_func_t *)0x0 },
6387 +  { ISFUNC, (rl_command_func_t *)0x0 },
6388 +  { ISFUNC, (rl_command_func_t *)0x0 },
6389 +  { ISFUNC, (rl_command_func_t *)0x0 },
6390 +  { ISFUNC, (rl_command_func_t *)0x0 },
6391 +  { ISFUNC, (rl_command_func_t *)0x0 },
6392 +  { ISFUNC, (rl_command_func_t *)0x0 },
6393 +  { ISFUNC, (rl_command_func_t *)0x0 },
6394 +  { ISFUNC, (rl_command_func_t *)0x0 },
6395 +  { ISFUNC, (rl_command_func_t *)0x0 },
6396 +  { ISFUNC, (rl_command_func_t *)0x0 },
6397 +  { ISFUNC, (rl_command_func_t *)0x0 },
6398 +  { ISFUNC, (rl_command_func_t *)0x0 },
6399 +  { ISFUNC, (rl_command_func_t *)0x0 },
6400 +  { ISFUNC, (rl_command_func_t *)0x0 },
6401 +  { ISFUNC, (rl_command_func_t *)0x0 },
6402 +  { ISFUNC, (rl_command_func_t *)0x0 },
6403 +  { ISFUNC, (rl_command_func_t *)0x0 },
6404 +  { ISFUNC, (rl_command_func_t *)0x0 },
6405 +  { ISFUNC, (rl_command_func_t *)0x0 },
6406 +  { ISFUNC, (rl_command_func_t *)0x0 },
6407 +  { ISFUNC, (rl_command_func_t *)0x0 },
6408 +  { ISFUNC, (rl_command_func_t *)0x0 },
6409 +  { ISFUNC, (rl_command_func_t *)0x0 },
6410 +  { ISFUNC, (rl_command_func_t *)0x0 },
6411 +  { ISFUNC, (rl_command_func_t *)0x0 },
6412 +  { ISFUNC, (rl_command_func_t *)0x0 },
6413 +  { ISFUNC, (rl_command_func_t *)0x0 },
6414 +  { ISFUNC, (rl_command_func_t *)0x0 },
6415 +  { ISFUNC, (rl_command_func_t *)0x0 },
6416 +  { ISFUNC, (rl_command_func_t *)0x0 },
6417 +  { ISFUNC, (rl_command_func_t *)0x0 },
6418 +  { ISFUNC, (rl_command_func_t *)0x0 },
6419 +  { ISFUNC, (rl_command_func_t *)0x0 },
6420 +  { ISFUNC, (rl_command_func_t *)0x0 },
6421 +  { ISFUNC, (rl_command_func_t *)0x0 },
6422 +  { ISFUNC, (rl_command_func_t *)0x0 },
6423 +  { ISFUNC, (rl_command_func_t *)0x0 },
6424 +  { ISFUNC, (rl_command_func_t *)0x0 },
6425 +  { ISFUNC, (rl_command_func_t *)0x0 },
6426 +  { ISFUNC, (rl_command_func_t *)0x0 },
6427 +  { ISFUNC, (rl_command_func_t *)0x0 },
6428 +  { ISFUNC, (rl_command_func_t *)0x0 },
6429 +  { ISFUNC, (rl_command_func_t *)0x0 },
6430 +  { ISFUNC, (rl_command_func_t *)0x0 },
6431 +  { ISFUNC, (rl_command_func_t *)0x0 },
6432 +  { ISFUNC, (rl_command_func_t *)0x0 },
6433 +  { ISFUNC, (rl_command_func_t *)0x0 },
6434 +  { ISFUNC, (rl_command_func_t *)0x0 },
6435 +  { ISFUNC, (rl_command_func_t *)0x0 },
6436 +  { ISFUNC, (rl_command_func_t *)0x0 },
6437 +  { ISFUNC, (rl_command_func_t *)0x0 },
6438 +  { ISFUNC, (rl_command_func_t *)0x0 },
6439 +  { ISFUNC, (rl_command_func_t *)0x0 },
6440 +  { ISFUNC, (rl_command_func_t *)0x0 },
6441 +  { ISFUNC, (rl_command_func_t *)0x0 },
6442 +  { ISFUNC, (rl_command_func_t *)0x0 },
6443 +  { ISFUNC, (rl_command_func_t *)0x0 },
6444 +  { ISFUNC, (rl_command_func_t *)0x0 },
6445 +  { ISFUNC, (rl_command_func_t *)0x0 },
6446 +  { ISFUNC, (rl_command_func_t *)0x0 },
6447 +  { ISFUNC, (rl_command_func_t *)0x0 },
6448 +  { ISFUNC, (rl_command_func_t *)0x0 },
6449 +  { ISFUNC, (rl_command_func_t *)0x0 },
6450 +  { ISFUNC, (rl_command_func_t *)0x0 },
6451 +  { ISFUNC, (rl_command_func_t *)0x0 },
6452 +  { ISFUNC, (rl_command_func_t *)0x0 },
6453 +  { ISFUNC, (rl_command_func_t *)0x0 },
6454 +  { ISFUNC, (rl_command_func_t *)0x0 },
6455 +  { ISFUNC, (rl_command_func_t *)0x0 },
6456 +  { ISFUNC, (rl_command_func_t *)0x0 },
6457 +  { ISFUNC, (rl_command_func_t *)0x0 },
6458 +  { ISFUNC, (rl_command_func_t *)0x0 },
6459 +  { ISFUNC, (rl_command_func_t *)0x0 },
6460 +  { ISFUNC, (rl_command_func_t *)0x0 },
6461 +  { ISFUNC, (rl_command_func_t *)0x0 },
6462 +  { ISFUNC, (rl_command_func_t *)0x0 },
6463 +  { ISFUNC, (rl_command_func_t *)0x0 },
6464 +  { ISFUNC, (rl_command_func_t *)0x0 },
6465 +  { ISFUNC, (rl_command_func_t *)0x0 },
6466 +  { ISFUNC, (rl_command_func_t *)0x0 },
6467 +  { ISFUNC, (rl_command_func_t *)0x0 },
6468 +  { ISFUNC, (rl_command_func_t *)0x0 },
6469 +  { ISFUNC, (rl_command_func_t *)0x0 },
6470 +  { ISFUNC, (rl_command_func_t *)0x0 },
6471 +  { ISFUNC, (rl_command_func_t *)0x0 },
6472 +  { ISFUNC, (rl_command_func_t *)0x0 },
6473 +  { ISFUNC, (rl_command_func_t *)0x0 },
6474 +  { ISFUNC, (rl_command_func_t *)0x0 },
6475 +  { ISFUNC, (rl_command_func_t *)0x0 },
6476 +  { ISFUNC, (rl_command_func_t *)0x0 },
6477 +  { ISFUNC, (rl_command_func_t *)0x0 },
6478 +  { ISFUNC, (rl_command_func_t *)0x0 },
6479 +  { ISFUNC, (rl_command_func_t *)0x0 },
6480 +  { ISFUNC, (rl_command_func_t *)0x0 },
6481 +  { ISFUNC, (rl_command_func_t *)0x0 },
6482 +  { ISFUNC, (rl_command_func_t *)0x0 },
6483 +  { ISFUNC, (rl_command_func_t *)0x0 },
6484 +  { ISFUNC, (rl_command_func_t *)0x0 },
6485 +  { ISFUNC, (rl_command_func_t *)0x0 },
6486 +  { ISFUNC, (rl_command_func_t *)0x0 },
6487 +  { ISFUNC, (rl_command_func_t *)0x0 },
6488 +  { ISFUNC, (rl_command_func_t *)0x0 },
6489 +  { ISFUNC, (rl_command_func_t *)0x0 },
6490 +  { ISFUNC, (rl_command_func_t *)0x0 },
6491 +  { ISFUNC, (rl_command_func_t *)0x0 },
6492 +  { ISFUNC, (rl_command_func_t *)0x0 },
6493 +  { ISFUNC, (rl_command_func_t *)0x0 },
6494 +  { ISFUNC, (rl_command_func_t *)0x0 }
6495  #endif /* KEYMAP_SIZE > 128 */
6496  };
6498  KEYMAP_ENTRY_ARRAY emacs_ctlx_keymap = {
6500    /* Control keys. */
6501 -  { ISFUNC, (Function *)0x0 },         /* Control-@ */
6502 -  { ISFUNC, (Function *)0x0 },         /* Control-a */
6503 -  { ISFUNC, (Function *)0x0 },         /* Control-b */
6504 -  { ISFUNC, (Function *)0x0 },         /* Control-c */
6505 -  { ISFUNC, (Function *)0x0 },         /* Control-d */
6506 -  { ISFUNC, (Function *)0x0 },         /* Control-e */
6507 -  { ISFUNC, (Function *)0x0 },         /* Control-f */
6508 -  { ISFUNC, rl_abort },                        /* Control-g */
6509 -  { ISFUNC, (Function *)0x0 },         /* Control-h */
6510 -  { ISFUNC, (Function *)0x0 },         /* Control-i */
6511 -  { ISFUNC, (Function *)0x0 },         /* Control-j */
6512 -  { ISFUNC, (Function *)0x0 },         /* Control-k */
6513 -  { ISFUNC, (Function *)0x0 },         /* Control-l */
6514 -  { ISFUNC, (Function *)0x0 },         /* Control-m */
6515 -  { ISFUNC, (Function *)0x0 },         /* Control-n */
6516 -  { ISFUNC, (Function *)0x0 },         /* Control-o */
6517 -  { ISFUNC, (Function *)0x0 },         /* Control-p */
6518 -  { ISFUNC, (Function *)0x0 },         /* Control-q */
6519 -  { ISFUNC, rl_re_read_init_file },    /* Control-r */
6520 -  { ISFUNC, (Function *)0x0 },         /* Control-s */
6521 -  { ISFUNC, (Function *)0x0 },         /* Control-t */
6522 -  { ISFUNC, rl_undo_command },         /* Control-u */
6523 -  { ISFUNC, (Function *)0x0 },         /* Control-v */
6524 -  { ISFUNC, (Function *)0x0 },         /* Control-w */
6525 -  { ISFUNC, rl_exchange_point_and_mark },/* Control-x */
6526 -  { ISFUNC, (Function *)0x0 },         /* Control-y */
6527 -  { ISFUNC, (Function *)0x0 },         /* Control-z */
6528 -  { ISFUNC, (Function *)0x0 },         /* Control-[ */
6529 -  { ISFUNC, (Function *)0x0 },         /* Control-\ */
6530 -  { ISFUNC, (Function *)0x0 },         /* Control-] */
6531 -  { ISFUNC, (Function *)0x0 },         /* Control-^ */
6532 -  { ISFUNC, (Function *)0x0 },         /* Control-_ */
6533 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-@ */
6534 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-a */
6535 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-b */
6536 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-c */
6537 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-d */
6538 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-e */
6539 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-f */
6540 +  { ISFUNC, rl_abort },                                /* Control-g */
6541 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-h */
6542 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-i */
6543 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-j */
6544 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-k */
6545 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-l */
6546 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-m */
6547 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-n */
6548 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-o */
6549 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-p */
6550 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-q */
6551 +  { ISFUNC, rl_re_read_init_file },            /* Control-r */
6552 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-s */
6553 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-t */
6554 +  { ISFUNC, rl_undo_command },                 /* Control-u */
6555 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-v */
6556 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-w */
6557 +  { ISFUNC, rl_exchange_point_and_mark },      /* Control-x */
6558 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-y */
6559 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-z */
6560 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-[ */
6561 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-\ */
6562 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-] */
6563 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-^ */
6564 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-_ */
6566    /* The start of printing characters. */
6567 -  { ISFUNC, (Function *)0x0 },         /* SPACE */
6568 -  { ISFUNC, (Function *)0x0 },         /* ! */
6569 -  { ISFUNC, (Function *)0x0 },         /* " */
6570 -  { ISFUNC, (Function *)0x0 },         /* # */
6571 -  { ISFUNC, (Function *)0x0 },         /* $ */
6572 -  { ISFUNC, (Function *)0x0 },         /* % */
6573 -  { ISFUNC, (Function *)0x0 },         /* & */
6574 -  { ISFUNC, (Function *)0x0 },         /* ' */
6575 -  { ISFUNC, rl_start_kbd_macro },      /* ( */
6576 -  { ISFUNC, rl_end_kbd_macro  },       /* ) */
6577 -  { ISFUNC, (Function *)0x0 },         /* * */
6578 -  { ISFUNC, (Function *)0x0 },         /* + */
6579 -  { ISFUNC, (Function *)0x0 },         /* , */
6580 -  { ISFUNC, (Function *)0x0 },         /* - */
6581 -  { ISFUNC, (Function *)0x0 },         /* . */
6582 -  { ISFUNC, (Function *)0x0 },         /* / */
6583 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* SPACE */
6584 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ! */
6585 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* " */
6586 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* # */
6587 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* $ */
6588 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* % */
6589 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* & */
6590 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ' */
6591 +  { ISFUNC, rl_start_kbd_macro },              /* ( */
6592 +  { ISFUNC, rl_end_kbd_macro  },               /* ) */
6593 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* * */
6594 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* + */
6595 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* , */
6596 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* - */
6597 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* . */
6598 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* / */
6600    /* Regular digits. */
6601 -  { ISFUNC, (Function *)0x0 },         /* 0 */
6602 -  { ISFUNC, (Function *)0x0 },         /* 1 */
6603 -  { ISFUNC, (Function *)0x0 },         /* 2 */
6604 -  { ISFUNC, (Function *)0x0 },         /* 3 */
6605 -  { ISFUNC, (Function *)0x0 },         /* 4 */
6606 -  { ISFUNC, (Function *)0x0 },         /* 5 */
6607 -  { ISFUNC, (Function *)0x0 },         /* 6 */
6608 -  { ISFUNC, (Function *)0x0 },         /* 7 */
6609 -  { ISFUNC, (Function *)0x0 },         /* 8 */
6610 -  { ISFUNC, (Function *)0x0 },         /* 9 */
6611 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 0 */
6612 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 1 */
6613 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 2 */
6614 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 3 */
6615 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 4 */
6616 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 5 */
6617 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 6 */
6618 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 7 */
6619 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 8 */
6620 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* 9 */
6622    /* A little more punctuation. */
6623 -  { ISFUNC, (Function *)0x0 }, /* : */
6624 -  { ISFUNC, (Function *)0x0 }, /* ; */
6625 -  { ISFUNC, (Function *)0x0 }, /* < */
6626 -  { ISFUNC, (Function *)0x0 }, /* = */
6627 -  { ISFUNC, (Function *)0x0 }, /* > */
6628 -  { ISFUNC, (Function *)0x0 }, /* ? */
6629 -  { ISFUNC, (Function *)0x0 }, /* @ */
6630 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* : */
6631 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ; */
6632 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* < */
6633 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* = */
6634 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* > */
6635 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ? */
6636 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* @ */
6638    /* Uppercase alphabet. */
6639 -  { ISFUNC, rl_do_lowercase_version }, /* A */
6640 -  { ISFUNC, rl_do_lowercase_version }, /* B */
6641 -  { ISFUNC, rl_do_lowercase_version }, /* C */
6642 -  { ISFUNC, rl_do_lowercase_version }, /* D */
6643 -  { ISFUNC, rl_do_lowercase_version }, /* E */
6644 -  { ISFUNC, rl_do_lowercase_version }, /* F */
6645 -  { ISFUNC, rl_do_lowercase_version }, /* G */
6646 -  { ISFUNC, rl_do_lowercase_version }, /* H */
6647 -  { ISFUNC, rl_do_lowercase_version }, /* I */
6648 -  { ISFUNC, rl_do_lowercase_version }, /* J */
6649 -  { ISFUNC, rl_do_lowercase_version }, /* K */
6650 -  { ISFUNC, rl_do_lowercase_version }, /* L */
6651 -  { ISFUNC, rl_do_lowercase_version }, /* M */
6652 -  { ISFUNC, rl_do_lowercase_version }, /* N */
6653 -  { ISFUNC, rl_do_lowercase_version }, /* O */
6654 -  { ISFUNC, rl_do_lowercase_version }, /* P */
6655 -  { ISFUNC, rl_do_lowercase_version }, /* Q */
6656 -  { ISFUNC, rl_do_lowercase_version }, /* R */
6657 -  { ISFUNC, rl_do_lowercase_version }, /* S */
6658 -  { ISFUNC, rl_do_lowercase_version }, /* T */
6659 -  { ISFUNC, rl_do_lowercase_version }, /* U */
6660 -  { ISFUNC, rl_do_lowercase_version }, /* V */
6661 -  { ISFUNC, rl_do_lowercase_version }, /* W */
6662 -  { ISFUNC, rl_do_lowercase_version }, /* X */
6663 -  { ISFUNC, rl_do_lowercase_version }, /* Y */
6664 -  { ISFUNC, rl_do_lowercase_version }, /* Z */
6665 +  { ISFUNC, rl_do_lowercase_version },         /* A */
6666 +  { ISFUNC, rl_do_lowercase_version },         /* B */
6667 +  { ISFUNC, rl_do_lowercase_version },         /* C */
6668 +  { ISFUNC, rl_do_lowercase_version },         /* D */
6669 +  { ISFUNC, rl_do_lowercase_version },         /* E */
6670 +  { ISFUNC, rl_do_lowercase_version },         /* F */
6671 +  { ISFUNC, rl_do_lowercase_version },         /* G */
6672 +  { ISFUNC, rl_do_lowercase_version },         /* H */
6673 +  { ISFUNC, rl_do_lowercase_version },         /* I */
6674 +  { ISFUNC, rl_do_lowercase_version },         /* J */
6675 +  { ISFUNC, rl_do_lowercase_version },         /* K */
6676 +  { ISFUNC, rl_do_lowercase_version },         /* L */
6677 +  { ISFUNC, rl_do_lowercase_version },         /* M */
6678 +  { ISFUNC, rl_do_lowercase_version },         /* N */
6679 +  { ISFUNC, rl_do_lowercase_version },         /* O */
6680 +  { ISFUNC, rl_do_lowercase_version },         /* P */
6681 +  { ISFUNC, rl_do_lowercase_version },         /* Q */
6682 +  { ISFUNC, rl_do_lowercase_version },         /* R */
6683 +  { ISFUNC, rl_do_lowercase_version },         /* S */
6684 +  { ISFUNC, rl_do_lowercase_version },         /* T */
6685 +  { ISFUNC, rl_do_lowercase_version },         /* U */
6686 +  { ISFUNC, rl_do_lowercase_version },         /* V */
6687 +  { ISFUNC, rl_do_lowercase_version },         /* W */
6688 +  { ISFUNC, rl_do_lowercase_version },         /* X */
6689 +  { ISFUNC, rl_do_lowercase_version },         /* Y */
6690 +  { ISFUNC, rl_do_lowercase_version },         /* Z */
6692    /* Some more punctuation. */
6693 -  { ISFUNC, (Function *)0x0 },         /* [ */
6694 -  { ISFUNC, (Function *)0x0 },         /* \ */
6695 -  { ISFUNC, (Function *)0x0 },         /* ] */
6696 -  { ISFUNC, (Function *)0x0 },         /* ^ */
6697 -  { ISFUNC, (Function *)0x0 },         /* _ */
6698 -  { ISFUNC, (Function *)0x0 },         /* ` */
6699 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* [ */
6700 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* \ */
6701 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ] */
6702 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ^ */
6703 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* _ */
6704 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ` */
6706    /* Lowercase alphabet. */
6707 -  { ISFUNC, (Function *)0x0 },         /* a */
6708 -  { ISFUNC, (Function *)0x0 },         /* b */
6709 -  { ISFUNC, (Function *)0x0 },         /* c */
6710 -  { ISFUNC, (Function *)0x0 },         /* d */
6711 -  { ISFUNC, rl_call_last_kbd_macro },  /* e */
6712 -  { ISFUNC, (Function *)0x0 },         /* f */
6713 -  { ISFUNC, (Function *)0x0 },         /* g */
6714 -  { ISFUNC, (Function *)0x0 },         /* h */
6715 -  { ISFUNC, (Function *)0x0 },         /* i */
6716 -  { ISFUNC, (Function *)0x0 },         /* j */
6717 -  { ISFUNC, (Function *)0x0 },         /* k */
6718 -  { ISFUNC, (Function *)0x0 },         /* l */
6719 -  { ISFUNC, (Function *)0x0 },         /* m */
6720 -  { ISFUNC, (Function *)0x0 },         /* n */
6721 -  { ISFUNC, (Function *)0x0 },         /* o */
6722 -  { ISFUNC, (Function *)0x0 },         /* p */
6723 -  { ISFUNC, (Function *)0x0 },         /* q */
6724 -  { ISFUNC, (Function *)0x0 },         /* r */
6725 -  { ISFUNC, (Function *)0x0 },         /* s */
6726 -  { ISFUNC, (Function *)0x0 },         /* t */
6727 -  { ISFUNC, (Function *)0x0 },         /* u */
6728 -  { ISFUNC, (Function *)0x0 },         /* v */
6729 -  { ISFUNC, (Function *)0x0 },         /* w */
6730 -  { ISFUNC, (Function *)0x0 },         /* x */
6731 -  { ISFUNC, (Function *)0x0 },         /* y */
6732 -  { ISFUNC, (Function *)0x0 },         /* z */
6733 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* a */
6734 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* b */
6735 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* c */
6736 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* d */
6737 +  { ISFUNC, rl_call_last_kbd_macro },          /* e */
6738 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* f */
6739 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* g */
6740 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* h */
6741 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* i */
6742 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* j */
6743 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* k */
6744 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* l */
6745 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* m */
6746 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* n */
6747 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* o */
6748 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* p */
6749 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* q */
6750 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* r */
6751 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* s */
6752 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* t */
6753 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* u */
6754 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* v */
6755 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* w */
6756 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* x */
6757 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* y */
6758 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* z */
6760    /* Final punctuation. */
6761 -  { ISFUNC, (Function *)0x0 },         /* { */
6762 -  { ISFUNC, (Function *)0x0 },         /* | */
6763 -  { ISFUNC, (Function *)0x0 },         /* } */
6764 -  { ISFUNC, (Function *)0x0 },         /* ~ */
6765 -  { ISFUNC, rl_backward_kill_line },   /* RUBOUT */
6766 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* { */
6767 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* | */
6768 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* } */
6769 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ~ */
6770 +  { ISFUNC, rl_backward_kill_line },           /* RUBOUT */
6772  #if KEYMAP_SIZE > 128
6773    /* Undefined keys. */
6774 -  { ISFUNC, (Function *)0x0 },
6775 -  { ISFUNC, (Function *)0x0 },
6776 -  { ISFUNC, (Function *)0x0 },
6777 -  { ISFUNC, (Function *)0x0 },
6778 -  { ISFUNC, (Function *)0x0 },
6779 -  { ISFUNC, (Function *)0x0 },
6780 -  { ISFUNC, (Function *)0x0 },
6781 -  { ISFUNC, (Function *)0x0 },
6782 -  { ISFUNC, (Function *)0x0 },
6783 -  { ISFUNC, (Function *)0x0 },
6784 -  { ISFUNC, (Function *)0x0 },
6785 -  { ISFUNC, (Function *)0x0 },
6786 -  { ISFUNC, (Function *)0x0 },
6787 -  { ISFUNC, (Function *)0x0 },
6788 -  { ISFUNC, (Function *)0x0 },
6789 -  { ISFUNC, (Function *)0x0 },
6790 -  { ISFUNC, (Function *)0x0 },
6791 -  { ISFUNC, (Function *)0x0 },
6792 -  { ISFUNC, (Function *)0x0 },
6793 -  { ISFUNC, (Function *)0x0 },
6794 -  { ISFUNC, (Function *)0x0 },
6795 -  { ISFUNC, (Function *)0x0 },
6796 -  { ISFUNC, (Function *)0x0 },
6797 -  { ISFUNC, (Function *)0x0 },
6798 -  { ISFUNC, (Function *)0x0 },
6799 -  { ISFUNC, (Function *)0x0 },
6800 -  { ISFUNC, (Function *)0x0 },
6801 -  { ISFUNC, (Function *)0x0 },
6802 -  { ISFUNC, (Function *)0x0 },
6803 -  { ISFUNC, (Function *)0x0 },
6804 -  { ISFUNC, (Function *)0x0 },
6805 -  { ISFUNC, (Function *)0x0 },
6806 -  { ISFUNC, (Function *)0x0 },
6807 -  { ISFUNC, (Function *)0x0 },
6808 -  { ISFUNC, (Function *)0x0 },
6809 -  { ISFUNC, (Function *)0x0 },
6810 -  { ISFUNC, (Function *)0x0 },
6811 -  { ISFUNC, (Function *)0x0 },
6812 -  { ISFUNC, (Function *)0x0 },
6813 -  { ISFUNC, (Function *)0x0 },
6814 -  { ISFUNC, (Function *)0x0 },
6815 -  { ISFUNC, (Function *)0x0 },
6816 -  { ISFUNC, (Function *)0x0 },
6817 -  { ISFUNC, (Function *)0x0 },
6818 -  { ISFUNC, (Function *)0x0 },
6819 -  { ISFUNC, (Function *)0x0 },
6820 -  { ISFUNC, (Function *)0x0 },
6821 -  { ISFUNC, (Function *)0x0 },
6822 -  { ISFUNC, (Function *)0x0 },
6823 -  { ISFUNC, (Function *)0x0 },
6824 -  { ISFUNC, (Function *)0x0 },
6825 -  { ISFUNC, (Function *)0x0 },
6826 -  { ISFUNC, (Function *)0x0 },
6827 -  { ISFUNC, (Function *)0x0 },
6828 -  { ISFUNC, (Function *)0x0 },
6829 -  { ISFUNC, (Function *)0x0 },
6830 -  { ISFUNC, (Function *)0x0 },
6831 -  { ISFUNC, (Function *)0x0 },
6832 -  { ISFUNC, (Function *)0x0 },
6833 -  { ISFUNC, (Function *)0x0 },
6834 -  { ISFUNC, (Function *)0x0 },
6835 -  { ISFUNC, (Function *)0x0 },
6836 -  { ISFUNC, (Function *)0x0 },
6837 -  { ISFUNC, (Function *)0x0 },
6838 -  { ISFUNC, (Function *)0x0 },
6839 -  { ISFUNC, (Function *)0x0 },
6840 -  { ISFUNC, (Function *)0x0 },
6841 -  { ISFUNC, (Function *)0x0 },
6842 -  { ISFUNC, (Function *)0x0 },
6843 -  { ISFUNC, (Function *)0x0 },
6844 -  { ISFUNC, (Function *)0x0 },
6845 -  { ISFUNC, (Function *)0x0 },
6846 -  { ISFUNC, (Function *)0x0 },
6847 -  { ISFUNC, (Function *)0x0 },
6848 -  { ISFUNC, (Function *)0x0 },
6849 -  { ISFUNC, (Function *)0x0 },
6850 -  { ISFUNC, (Function *)0x0 },
6851 -  { ISFUNC, (Function *)0x0 },
6852 -  { ISFUNC, (Function *)0x0 },
6853 -  { ISFUNC, (Function *)0x0 },
6854 -  { ISFUNC, (Function *)0x0 },
6855 -  { ISFUNC, (Function *)0x0 },
6856 -  { ISFUNC, (Function *)0x0 },
6857 -  { ISFUNC, (Function *)0x0 },
6858 -  { ISFUNC, (Function *)0x0 },
6859 -  { ISFUNC, (Function *)0x0 },
6860 -  { ISFUNC, (Function *)0x0 },
6861 -  { ISFUNC, (Function *)0x0 },
6862 -  { ISFUNC, (Function *)0x0 },
6863 -  { ISFUNC, (Function *)0x0 },
6864 -  { ISFUNC, (Function *)0x0 },
6865 -  { ISFUNC, (Function *)0x0 },
6866 -  { ISFUNC, (Function *)0x0 },
6867 -  { ISFUNC, (Function *)0x0 },
6868 -  { ISFUNC, (Function *)0x0 },
6869 -  { ISFUNC, (Function *)0x0 },
6870 -  { ISFUNC, (Function *)0x0 },
6871 -  { ISFUNC, (Function *)0x0 },
6872 -  { ISFUNC, (Function *)0x0 },
6873 -  { ISFUNC, (Function *)0x0 },
6874 -  { ISFUNC, (Function *)0x0 },
6875 -  { ISFUNC, (Function *)0x0 },
6876 -  { ISFUNC, (Function *)0x0 },
6877 -  { ISFUNC, (Function *)0x0 },
6878 -  { ISFUNC, (Function *)0x0 },
6879 -  { ISFUNC, (Function *)0x0 },
6880 -  { ISFUNC, (Function *)0x0 },
6881 -  { ISFUNC, (Function *)0x0 },
6882 -  { ISFUNC, (Function *)0x0 },
6883 -  { ISFUNC, (Function *)0x0 },
6884 -  { ISFUNC, (Function *)0x0 },
6885 -  { ISFUNC, (Function *)0x0 },
6886 -  { ISFUNC, (Function *)0x0 },
6887 -  { ISFUNC, (Function *)0x0 },
6888 -  { ISFUNC, (Function *)0x0 },
6889 -  { ISFUNC, (Function *)0x0 },
6890 -  { ISFUNC, (Function *)0x0 },
6891 -  { ISFUNC, (Function *)0x0 },
6892 -  { ISFUNC, (Function *)0x0 },
6893 -  { ISFUNC, (Function *)0x0 },
6894 -  { ISFUNC, (Function *)0x0 },
6895 -  { ISFUNC, (Function *)0x0 },
6896 -  { ISFUNC, (Function *)0x0 },
6897 -  { ISFUNC, (Function *)0x0 },
6898 -  { ISFUNC, (Function *)0x0 },
6899 -  { ISFUNC, (Function *)0x0 },
6900 -  { ISFUNC, (Function *)0x0 },
6901 -  { ISFUNC, (Function *)0x0 }
6902 +  { ISFUNC, (rl_command_func_t *)0x0 },
6903 +  { ISFUNC, (rl_command_func_t *)0x0 },
6904 +  { ISFUNC, (rl_command_func_t *)0x0 },
6905 +  { ISFUNC, (rl_command_func_t *)0x0 },
6906 +  { ISFUNC, (rl_command_func_t *)0x0 },
6907 +  { ISFUNC, (rl_command_func_t *)0x0 },
6908 +  { ISFUNC, (rl_command_func_t *)0x0 },
6909 +  { ISFUNC, (rl_command_func_t *)0x0 },
6910 +  { ISFUNC, (rl_command_func_t *)0x0 },
6911 +  { ISFUNC, (rl_command_func_t *)0x0 },
6912 +  { ISFUNC, (rl_command_func_t *)0x0 },
6913 +  { ISFUNC, (rl_command_func_t *)0x0 },
6914 +  { ISFUNC, (rl_command_func_t *)0x0 },
6915 +  { ISFUNC, (rl_command_func_t *)0x0 },
6916 +  { ISFUNC, (rl_command_func_t *)0x0 },
6917 +  { ISFUNC, (rl_command_func_t *)0x0 },
6918 +  { ISFUNC, (rl_command_func_t *)0x0 },
6919 +  { ISFUNC, (rl_command_func_t *)0x0 },
6920 +  { ISFUNC, (rl_command_func_t *)0x0 },
6921 +  { ISFUNC, (rl_command_func_t *)0x0 },
6922 +  { ISFUNC, (rl_command_func_t *)0x0 },
6923 +  { ISFUNC, (rl_command_func_t *)0x0 },
6924 +  { ISFUNC, (rl_command_func_t *)0x0 },
6925 +  { ISFUNC, (rl_command_func_t *)0x0 },
6926 +  { ISFUNC, (rl_command_func_t *)0x0 },
6927 +  { ISFUNC, (rl_command_func_t *)0x0 },
6928 +  { ISFUNC, (rl_command_func_t *)0x0 },
6929 +  { ISFUNC, (rl_command_func_t *)0x0 },
6930 +  { ISFUNC, (rl_command_func_t *)0x0 },
6931 +  { ISFUNC, (rl_command_func_t *)0x0 },
6932 +  { ISFUNC, (rl_command_func_t *)0x0 },
6933 +  { ISFUNC, (rl_command_func_t *)0x0 },
6934 +  { ISFUNC, (rl_command_func_t *)0x0 },
6935 +  { ISFUNC, (rl_command_func_t *)0x0 },
6936 +  { ISFUNC, (rl_command_func_t *)0x0 },
6937 +  { ISFUNC, (rl_command_func_t *)0x0 },
6938 +  { ISFUNC, (rl_command_func_t *)0x0 },
6939 +  { ISFUNC, (rl_command_func_t *)0x0 },
6940 +  { ISFUNC, (rl_command_func_t *)0x0 },
6941 +  { ISFUNC, (rl_command_func_t *)0x0 },
6942 +  { ISFUNC, (rl_command_func_t *)0x0 },
6943 +  { ISFUNC, (rl_command_func_t *)0x0 },
6944 +  { ISFUNC, (rl_command_func_t *)0x0 },
6945 +  { ISFUNC, (rl_command_func_t *)0x0 },
6946 +  { ISFUNC, (rl_command_func_t *)0x0 },
6947 +  { ISFUNC, (rl_command_func_t *)0x0 },
6948 +  { ISFUNC, (rl_command_func_t *)0x0 },
6949 +  { ISFUNC, (rl_command_func_t *)0x0 },
6950 +  { ISFUNC, (rl_command_func_t *)0x0 },
6951 +  { ISFUNC, (rl_command_func_t *)0x0 },
6952 +  { ISFUNC, (rl_command_func_t *)0x0 },
6953 +  { ISFUNC, (rl_command_func_t *)0x0 },
6954 +  { ISFUNC, (rl_command_func_t *)0x0 },
6955 +  { ISFUNC, (rl_command_func_t *)0x0 },
6956 +  { ISFUNC, (rl_command_func_t *)0x0 },
6957 +  { ISFUNC, (rl_command_func_t *)0x0 },
6958 +  { ISFUNC, (rl_command_func_t *)0x0 },
6959 +  { ISFUNC, (rl_command_func_t *)0x0 },
6960 +  { ISFUNC, (rl_command_func_t *)0x0 },
6961 +  { ISFUNC, (rl_command_func_t *)0x0 },
6962 +  { ISFUNC, (rl_command_func_t *)0x0 },
6963 +  { ISFUNC, (rl_command_func_t *)0x0 },
6964 +  { ISFUNC, (rl_command_func_t *)0x0 },
6965 +  { ISFUNC, (rl_command_func_t *)0x0 },
6966 +  { ISFUNC, (rl_command_func_t *)0x0 },
6967 +  { ISFUNC, (rl_command_func_t *)0x0 },
6968 +  { ISFUNC, (rl_command_func_t *)0x0 },
6969 +  { ISFUNC, (rl_command_func_t *)0x0 },
6970 +  { ISFUNC, (rl_command_func_t *)0x0 },
6971 +  { ISFUNC, (rl_command_func_t *)0x0 },
6972 +  { ISFUNC, (rl_command_func_t *)0x0 },
6973 +  { ISFUNC, (rl_command_func_t *)0x0 },
6974 +  { ISFUNC, (rl_command_func_t *)0x0 },
6975 +  { ISFUNC, (rl_command_func_t *)0x0 },
6976 +  { ISFUNC, (rl_command_func_t *)0x0 },
6977 +  { ISFUNC, (rl_command_func_t *)0x0 },
6978 +  { ISFUNC, (rl_command_func_t *)0x0 },
6979 +  { ISFUNC, (rl_command_func_t *)0x0 },
6980 +  { ISFUNC, (rl_command_func_t *)0x0 },
6981 +  { ISFUNC, (rl_command_func_t *)0x0 },
6982 +  { ISFUNC, (rl_command_func_t *)0x0 },
6983 +  { ISFUNC, (rl_command_func_t *)0x0 },
6984 +  { ISFUNC, (rl_command_func_t *)0x0 },
6985 +  { ISFUNC, (rl_command_func_t *)0x0 },
6986 +  { ISFUNC, (rl_command_func_t *)0x0 },
6987 +  { ISFUNC, (rl_command_func_t *)0x0 },
6988 +  { ISFUNC, (rl_command_func_t *)0x0 },
6989 +  { ISFUNC, (rl_command_func_t *)0x0 },
6990 +  { ISFUNC, (rl_command_func_t *)0x0 },
6991 +  { ISFUNC, (rl_command_func_t *)0x0 },
6992 +  { ISFUNC, (rl_command_func_t *)0x0 },
6993 +  { ISFUNC, (rl_command_func_t *)0x0 },
6994 +  { ISFUNC, (rl_command_func_t *)0x0 },
6995 +  { ISFUNC, (rl_command_func_t *)0x0 },
6996 +  { ISFUNC, (rl_command_func_t *)0x0 },
6997 +  { ISFUNC, (rl_command_func_t *)0x0 },
6998 +  { ISFUNC, (rl_command_func_t *)0x0 },
6999 +  { ISFUNC, (rl_command_func_t *)0x0 },
7000 +  { ISFUNC, (rl_command_func_t *)0x0 },
7001 +  { ISFUNC, (rl_command_func_t *)0x0 },
7002 +  { ISFUNC, (rl_command_func_t *)0x0 },
7003 +  { ISFUNC, (rl_command_func_t *)0x0 },
7004 +  { ISFUNC, (rl_command_func_t *)0x0 },
7005 +  { ISFUNC, (rl_command_func_t *)0x0 },
7006 +  { ISFUNC, (rl_command_func_t *)0x0 },
7007 +  { ISFUNC, (rl_command_func_t *)0x0 },
7008 +  { ISFUNC, (rl_command_func_t *)0x0 },
7009 +  { ISFUNC, (rl_command_func_t *)0x0 },
7010 +  { ISFUNC, (rl_command_func_t *)0x0 },
7011 +  { ISFUNC, (rl_command_func_t *)0x0 },
7012 +  { ISFUNC, (rl_command_func_t *)0x0 },
7013 +  { ISFUNC, (rl_command_func_t *)0x0 },
7014 +  { ISFUNC, (rl_command_func_t *)0x0 },
7015 +  { ISFUNC, (rl_command_func_t *)0x0 },
7016 +  { ISFUNC, (rl_command_func_t *)0x0 },
7017 +  { ISFUNC, (rl_command_func_t *)0x0 },
7018 +  { ISFUNC, (rl_command_func_t *)0x0 },
7019 +  { ISFUNC, (rl_command_func_t *)0x0 },
7020 +  { ISFUNC, (rl_command_func_t *)0x0 },
7021 +  { ISFUNC, (rl_command_func_t *)0x0 },
7022 +  { ISFUNC, (rl_command_func_t *)0x0 },
7023 +  { ISFUNC, (rl_command_func_t *)0x0 },
7024 +  { ISFUNC, (rl_command_func_t *)0x0 },
7025 +  { ISFUNC, (rl_command_func_t *)0x0 },
7026 +  { ISFUNC, (rl_command_func_t *)0x0 },
7027 +  { ISFUNC, (rl_command_func_t *)0x0 },
7028 +  { ISFUNC, (rl_command_func_t *)0x0 },
7029 +  { ISFUNC, (rl_command_func_t *)0x0 }
7030  #endif /* KEYMAP_SIZE > 128 */
7031  };
7032 Index: readline/funmap.c
7033 ===================================================================
7034 RCS file: /prjz/.cvsroot/gdb/readline/funmap.c,v
7035 retrieving revision 1.1.1.1
7036 diff -u -3 -p -r1.1.1.1 funmap.c
7037 --- readline/funmap.c   2003/02/16 21:36:30     1.1.1.1
7038 +++ readline/funmap.c   2003/02/17 12:47:10
7039 @@ -46,7 +46,7 @@ typedef int QSFUNC (const void *, const 
7040  typedef int QSFUNC ();
7041  #endif
7043 -extern int _rl_qsort_string_compare ();
7044 +extern int _rl_qsort_string_compare __P((char **, char **));
7046  FUNMAP **funmap;
7047  static int funmap_size;
7048 @@ -108,7 +108,7 @@ static FUNMAP default_funmap[] = {
7049    { "non-incremental-reverse-search-history", rl_noninc_reverse_search },
7050    { "non-incremental-forward-search-history-again", rl_noninc_forward_search_again },
7051    { "non-incremental-reverse-search-history-again", rl_noninc_reverse_search_again },
7052 -#ifdef __CYGWIN32__
7053 +#if defined (__CYGWIN__) || defined (__MINGW32__)
7054    { "paste-from-clipboard", rl_paste_from_clipboard },
7055  #endif
7056    { "possible-completions", rl_possible_completions },
7057 @@ -142,7 +142,6 @@ static FUNMAP default_funmap[] = {
7058    { "vi-arg-digit", rl_vi_arg_digit },
7059    { "vi-back-to-indent", rl_vi_back_to_indent },
7060    { "vi-bWord", rl_vi_bWord },
7061 -  { "vi-bracktype", rl_vi_bracktype },
7062    { "vi-bword", rl_vi_bword },
7063    { "vi-change-case", rl_vi_change_case },
7064    { "vi-change-char", rl_vi_change_char },
7065 @@ -182,13 +181,13 @@ static FUNMAP default_funmap[] = {
7066    { "vi-yank-to", rl_vi_yank_to },
7067  #endif /* VI_MODE */
7069 - {(char *)NULL, (Function *)NULL }
7070 + {(char *)NULL, (rl_command_func_t *)NULL }
7071  };
7073  int
7074  rl_add_funmap_entry (name, function)
7075 -     char *name;
7076 -     Function *function;
7077 +     const char *name;
7078 +     rl_command_func_t *function;
7080    if (funmap_entry + 2 >= funmap_size)
7081      {
7082 @@ -225,21 +224,21 @@ rl_initialize_funmap ()
7083  /* Produce a NULL terminated array of known function names.  The array
7084     is sorted.  The array itself is allocated, but not the strings inside.
7085     You should free () the array when you done, but not the pointrs. */
7086 -char **
7087 +const char **
7088  rl_funmap_names ()
7090 -  char **result;
7091 +  const char **result;
7092    int result_size, result_index;
7094    /* Make sure that the function map has been initialized. */
7095    rl_initialize_funmap ();
7097 -  for (result_index = result_size = 0, result = (char **)NULL; funmap[result_index]; result_index++)
7098 +  for (result_index = result_size = 0, result = (const char **)NULL; funmap[result_index]; result_index++)
7099      {
7100        if (result_index + 2 > result_size)
7101         {
7102           result_size += 20;
7103 -         result = (char **)xrealloc (result, result_size * sizeof (char *));
7104 +         result = (const char **)xrealloc (result, result_size * sizeof (char *));
7105         }
7107        result[result_index] = funmap[result_index]->name;
7108 @@ -249,12 +248,3 @@ rl_funmap_names ()
7109    qsort (result, result_index, sizeof (char *), (QSFUNC *)_rl_qsort_string_compare);
7110    return (result);
7113 -/* Things that mean `Control'. */
7114 -char *possible_control_prefixes[] = {
7115 -  "Control-", "C-", "CTRL-", (char *)NULL
7118 -char *possible_meta_prefixes[] = {
7119 -  "Meta", "M-", (char *)NULL
7121 Index: readline/histexpand.c
7122 ===================================================================
7123 RCS file: /prjz/.cvsroot/gdb/readline/histexpand.c,v
7124 retrieving revision 1.1.1.1
7125 diff -u -3 -p -r1.1.1.1 histexpand.c
7126 --- readline/histexpand.c       2003/02/16 21:36:30     1.1.1.1
7127 +++ readline/histexpand.c       2001/03/06 19:09:25
7128 @@ -56,6 +56,8 @@
7129  #define HISTORY_WORD_DELIMITERS                " \t\n;&()|<>"
7130  #define HISTORY_QUOTE_CHARACTERS       "\"'`"
7132 +typedef int _hist_search_func_t __P((const char *, int));
7134  static char error_pointer;
7136  static char *subst_lhs;
7137 @@ -91,9 +93,12 @@ char *history_no_expand_chars = " \t\n\r
7138     The default is 0. */
7139  int history_quotes_inhibit_expansion = 0;
7141 +/* Used to split words by history_tokenize_internal. */
7142 +char *history_word_delimiters = HISTORY_WORD_DELIMITERS;
7144  /* If set, this points to a function that is called to verify that a
7145     particular history expansion should be performed. */
7146 -Function *history_inhibit_expansion_function;
7147 +rl_linebuf_func_t *history_inhibit_expansion_function;
7149  /* **************************************************************** */
7150  /*                                                                 */
7151 @@ -122,7 +127,7 @@ static char *search_match;
7152     line = get_history_event ("!echo:p", &index, 0);  */
7153  char *
7154  get_history_event (string, caller_index, delimiting_quote)
7155 -     char *string;
7156 +     const char *string;
7157       int *caller_index;
7158       int delimiting_quote;
7160 @@ -130,7 +135,7 @@ get_history_event (string, caller_index,
7161    register char c;
7162    HIST_ENTRY *entry;
7163    int which, sign, local_index, substring_okay;
7164 -  Function *search_func;
7165 +  _hist_search_func_t *search_func;
7166    char *temp;
7168    /* The event can be specified in a number of ways.
7169 @@ -340,7 +345,8 @@ hist_error(s, start, current, errtype)
7170        char *s;
7171        int start, current, errtype;
7173 -  char *temp, *emsg;
7174 +  char *temp;
7175 +  const char *emsg;
7176    int ll, elen;
7178    ll = current - start;
7179 @@ -622,7 +628,7 @@ history_expand_internal (string, start, 
7180         case '&':
7181         case 's':
7182           {
7183 -           char *new_event, *t;
7184 +           char *new_event;
7185             int delimiter, failed, si, l_temp;
7187             if (c == 's')
7188 @@ -741,7 +747,7 @@ history_expand_internal (string, start, 
7189        char *x;
7191        if (want_quotes == 'q')
7192 -       x = single_quote (temp);
7193 +       x = sh_single_quote (temp);
7194        else if (want_quotes == 'x')
7195         x = quote_breaks (temp);
7196        else
7197 @@ -816,6 +822,9 @@ history_expand (hstring, output)
7198    /* Used when adding the string. */
7199    char *temp;
7201 +  if (output == 0)
7202 +    return 0;
7204    /* Setting the history expansion character to 0 inhibits all
7205       history expansion. */
7206    if (history_expansion_char == 0)
7207 @@ -865,7 +874,7 @@ history_expand (hstring, output)
7208              history expansion performed on it.
7209              Skip the rest of the line and break out of the loop. */
7210           if (history_comment_char && string[i] == history_comment_char &&
7211 -             (i == 0 || member (string[i - 1], HISTORY_WORD_DELIMITERS)))
7212 +             (i == 0 || member (string[i - 1], history_word_delimiters)))
7213             {
7214               while (string[i])
7215                 i++;
7216 @@ -963,7 +972,7 @@ history_expand (hstring, output)
7217           }
7219         case -2:                /* history_comment_char */
7220 -         if (i == 0 || member (string[i - 1], HISTORY_WORD_DELIMITERS))
7221 +         if (i == 0 || member (string[i - 1], history_word_delimiters))
7222             {
7223               temp = xmalloc (l - i + 1);
7224               strcpy (temp, string + i);
7225 @@ -1151,7 +1160,7 @@ get_history_word_specifier (spec, from, 
7226  char *
7227  history_arg_extract (first, last, string)
7228       int first, last;
7229 -     char *string;
7230 +     const char *string;
7232    register int i, len;
7233    char *result;
7234 @@ -1217,13 +1226,18 @@ history_arg_extract (first, last, string
7235     *INDP. */
7236  static char **
7237  history_tokenize_internal (string, wind, indp)
7238 -     char *string;
7239 +     const char *string;
7240       int wind, *indp;
7242    char **result;
7243    register int i, start, result_index, size;
7244    int len, delimiter;
7246 +  /* If we're searching for a string that's not part of a word (e.g., " "),
7247 +     make sure we set *INDP to a reasonable value. */
7248 +  if (indp && wind != -1)
7249 +    *indp = -1;
7251    /* Get a token, and stuff it into RESULT.  The tokens are split
7252       exactly where the shell would split them. */
7253    for (i = result_index = size = 0, result = (char **)NULL; string[i]; )
7254 @@ -1298,7 +1312,7 @@ history_tokenize_internal (string, wind,
7255               continue;
7256             }
7258 -         if (!delimiter && (member (string[i], HISTORY_WORD_DELIMITERS)))
7259 +         if (!delimiter && (member (string[i], history_word_delimiters)))
7260             break;
7262           if (!delimiter && member (string[i], HISTORY_QUOTE_CHARACTERS))
7263 @@ -1328,7 +1342,7 @@ history_tokenize_internal (string, wind,
7264     parsed out of STRING. */
7265  char **
7266  history_tokenize (string)
7267 -     char *string;
7268 +     const char *string;
7270    return (history_tokenize_internal (string, -1, (int *)NULL));
7272 @@ -1345,7 +1359,7 @@ history_find_word (line, ind)
7273    int i, wind;
7275    words = history_tokenize_internal (line, ind, &wind);
7276 -  if (wind == -1)
7277 +  if (wind == -1 || words == 0)
7278      return ((char *)NULL);
7279    s = words[wind];
7280    for (i = 0; i < wind; i++)
7281 Index: readline/histfile.c
7282 ===================================================================
7283 RCS file: /prjz/.cvsroot/gdb/readline/histfile.c,v
7284 retrieving revision 1.1.1.1
7285 diff -u -3 -p -r1.1.1.1 histfile.c
7286 --- readline/histfile.c 2003/02/16 21:36:30     1.1.1.1
7287 +++ readline/histfile.c 2003/02/17 12:47:10
7288 @@ -32,7 +32,7 @@
7289  #include <stdio.h>
7291  #include <sys/types.h>
7292 -#ifndef _MINIX
7293 +#if HAVE_SYS_FILE_H
7294  #  include <sys/file.h>
7295  #endif
7296  #include "posixstat.h"
7297 @@ -54,12 +54,15 @@
7298  #  include <strings.h>
7299  #endif /* !HAVE_STRING_H */
7301 +#ifdef __MINGW32__
7302 +#include <io.h>
7303 +#endif
7305  /* If we're compiling for __EMX__ (OS/2) or __CYGWIN__ (cygwin32 environment
7306     on win 95/98/nt), we want to open files with O_BINARY mode so that there
7307     is no \n -> \r\n conversion performed.  On other systems, we don't want to
7308     mess around with O_BINARY at all, so we ensure that it's defined to 0. */
7309 -#if defined (__EMX__) || defined (__CYGWIN__)
7310 +#if defined (__EMX__) || defined (__CYGWIN__) || defined (__MINGW32__)
7311  #  ifndef O_BINARY
7312  #    define O_BINARY 0
7313  #  endif
7314 @@ -79,14 +82,20 @@ extern int errno;
7315  #include "rlshell.h"
7316  #include "xmalloc.h"
7318 +#ifdef __MINGW32__
7319 +#include "rldefs.h"
7320 +extern char *get_user_registry_string(char *keyName, char* valName);
7321 +#endif
7323  /* Return the string that should be used in the place of this
7324     filename.  This only matters when you don't specify the
7325     filename to read_history (), or write_history (). */
7326  static char *
7327  history_filename (filename)
7328 -     char *filename;
7329 +     const char *filename;
7331 -  char *return_val, *home;
7332 +  char *return_val;
7333 +  const char *home;
7334    int home_len;
7336    return_val = filename ? savestring (filename) : (char *)NULL;
7337 @@ -94,10 +103,16 @@ history_filename (filename)
7338    if (return_val)
7339      return (return_val);
7340    
7341 -  home = get_env_value ("HOME");
7342 +  home = sh_get_env_value ("HOME");
7344    if (home == 0)
7345      {
7346 +#if defined (__MINGW32__) && defined (INITFILES_IN_REGISTRY)
7347 +      return_val = get_user_registry_string (READLINE_REGKEY, HISTFILE_REGVAL);
7348 +      if (return_val)
7349 +        return (return_val);
7350 +      free (return_val);
7351 +#endif /* __MINGW32__ ... */
7352        home = ".";
7353        home_len = 1;
7354      }
7355 @@ -121,7 +136,7 @@ history_filename (filename)
7356     successful, or errno if not. */
7357  int
7358  read_history (filename)
7359 -     char *filename;
7360 +     const char *filename;
7362    return (read_history_range (filename, 0, -1));
7364 @@ -133,7 +148,7 @@ read_history (filename)
7365     ~/.history.  Returns 0 if successful, or errno if not. */
7366  int
7367  read_history_range (filename, from, to)
7368 -     char *filename;
7369 +     const char *filename;
7370       int from, to;
7372    register int line_start, line_end;
7373 @@ -221,14 +236,15 @@ read_history_range (filename, from, to)
7376  /* Truncate the history file FNAME, leaving only LINES trailing lines.
7377 -   If FNAME is NULL, then use ~/.history. */
7378 +   If FNAME is NULL, then use ~/.history.  Returns 0 on success, errno
7379 +   on failure. */
7380  int
7381  history_truncate_file (fname, lines)
7382 -     char *fname;
7383 +     const char *fname;
7384       int lines;
7386    register int i;
7387 -  int file, chars_read;
7388 +  int file, chars_read, rv;
7389    char *buffer, *filename;
7390    struct stat finfo;
7391    size_t file_size;
7392 @@ -236,13 +252,27 @@ history_truncate_file (fname, lines)
7393    buffer = (char *)NULL;
7394    filename = history_filename (fname);
7395    file = open (filename, O_RDONLY|O_BINARY, 0666);
7396 +  rv = 0;
7398 +  /* Don't try to truncate non-regular files. */
7399    if (file == -1 || fstat (file, &finfo) == -1)
7400 -    goto truncate_exit;
7401 +    {
7402 +      rv = errno;
7403 +      if (file != -1)
7404 +       close (file);
7405 +      goto truncate_exit;
7406 +    }
7408 -  /* Don't try to truncate non-regular files. */
7409 -  if (S_ISREG(finfo.st_mode) == 0)
7410 -    goto truncate_exit;
7411 +  if (S_ISREG (finfo.st_mode) == 0)
7412 +    {
7413 +      close (file);
7414 +#ifdef EFTYPE
7415 +      rv = EFTYPE;
7416 +#else
7417 +      rv = EINVAL;
7418 +#endif
7419 +      goto truncate_exit;
7420 +    }
7422    file_size = (size_t)finfo.st_size;
7424 @@ -251,7 +281,11 @@ history_truncate_file (fname, lines)
7425      {
7426        close (file);
7427  #if defined (EFBIG)
7428 -      errno = EFBIG;
7429 +      rv = errno = EFBIG;
7430 +#elif defined (EOVERFLOW)
7431 +      rv = errno = EOVERFLOW;
7432 +#else
7433 +      rv = errno = EINVAL;
7434  #endif
7435        goto truncate_exit;
7436      }
7437 @@ -261,7 +295,10 @@ history_truncate_file (fname, lines)
7438    close (file);
7440    if (chars_read <= 0)
7441 -    goto truncate_exit;
7442 +    {
7443 +      rv = (chars_read < 0) ? errno : 0;
7444 +      goto truncate_exit;
7445 +    }
7447    /* Count backwards from the end of buffer until we have passed
7448       LINES lines. */
7449 @@ -302,7 +339,7 @@ history_truncate_file (fname, lines)
7450    FREE (buffer);
7452    free (filename);
7453 -  return 0;
7454 +  return rv;
7457  /* Workhorse function for writing history.  Writes NELEMENT entries
7458 @@ -310,15 +347,16 @@ history_truncate_file (fname, lines)
7459     wish to replace FILENAME with the entries. */
7460  static int
7461  history_do_write (filename, nelements, overwrite)
7462 -     char *filename;
7463 +     const char *filename;
7464       int nelements, overwrite;
7466    register int i;
7467    char *output;
7468 -  int file, mode;
7469 +  int file, mode, rv;
7471    mode = overwrite ? O_WRONLY|O_CREAT|O_TRUNC|O_BINARY : O_WRONLY|O_APPEND|O_BINARY;
7472    output = history_filename (filename);
7473 +  rv = 0;
7475    if ((file = open (output, mode, 0600)) == -1)
7476      {
7477 @@ -352,7 +390,8 @@ history_do_write (filename, nelements, o
7478         buffer[j++] = '\n';
7479        }
7481 -    write (file, buffer, buffer_size);
7482 +    if (write (file, buffer, buffer_size) < 0)
7483 +      rv = errno;
7484      free (buffer);
7485    }
7487 @@ -360,7 +399,7 @@ history_do_write (filename, nelements, o
7489    FREE (output);
7491 -  return (0);
7492 +  return (rv);
7495  /* Append NELEMENT entries to FILENAME.  The entries appended are from
7496 @@ -368,7 +407,7 @@ history_do_write (filename, nelements, o
7497  int
7498  append_history (nelements, filename)
7499       int nelements;
7500 -     char *filename;
7501 +     const char *filename;
7503    return (history_do_write (filename, nelements, HISTORY_APPEND));
7505 @@ -378,7 +417,7 @@ append_history (nelements, filename)
7506     are as in read_history ().*/
7507  int
7508  write_history (filename)
7509 -     char *filename;
7510 +     const char *filename;
7512    return (history_do_write (filename, history_length, HISTORY_OVERWRITE));
7514 Index: readline/histlib.h
7515 ===================================================================
7516 RCS file: /prjz/.cvsroot/gdb/readline/histlib.h,v
7517 retrieving revision 1.1.1.1
7518 diff -u -3 -p -r1.1.1.1 histlib.h
7519 --- readline/histlib.h  2003/02/16 21:36:30     1.1.1.1
7520 +++ readline/histlib.h  2000/10/30 19:18:45
7521 @@ -22,15 +22,6 @@
7522  #if !defined (_HISTLIB_H_)
7523  #define _HISTLIB_H_
7525 -/* Function pointers can be declared as (Function *)foo. */
7526 -#if !defined (_FUNCTION_DEF)
7527 -#  define _FUNCTION_DEF
7528 -typedef int Function ();
7529 -typedef void VFunction ();
7530 -typedef char *CPFunction ();
7531 -typedef char **CPPFunction ();
7532 -#endif /* _FUNCTION_DEF */
7534  #if !defined (STREQ)
7535  #define STREQ(a, b)    (((a)[0] == (b)[0]) && (strcmp ((a), (b)) == 0))
7536  #define STREQN(a, b, n) (((n) == 0) ? (1) \
7537 Index: readline/history.c
7538 ===================================================================
7539 RCS file: /prjz/.cvsroot/gdb/readline/history.c,v
7540 retrieving revision 1.1.1.1
7541 diff -u -3 -p -r1.1.1.1 history.c
7542 --- readline/history.c  2003/02/16 21:36:30     1.1.1.1
7543 +++ readline/history.c  2001/03/06 18:34:44
7544 @@ -73,7 +73,8 @@ static int history_stifled;
7546  /* If HISTORY_STIFLED is non-zero, then this is the maximum number of
7547     entries to remember. */
7548 -int max_input_history;
7549 +int history_max_entries;
7550 +int max_input_history; /* backwards compatibility */
7552  /* The current location of the interactive history pointer.  Just makes
7553     life easier for outside callers. */
7554 @@ -134,9 +135,7 @@ history_total_bytes ()
7556    register int i, result;
7558 -  result = 0;
7560 -  for (i = 0; the_history && the_history[i]; i++)
7561 +  for (i = result = 0; the_history && the_history[i]; i++)
7562      result += strlen (the_history[i]->line);
7564    return (result);
7565 @@ -217,16 +216,16 @@ history_get (offset)
7566     is  set to NULL. */
7567  void
7568  add_history (string)
7569 -     char *string;
7570 +     const char *string;
7572    HIST_ENTRY *temp;
7574 -  if (history_stifled && (history_length == max_input_history))
7575 +  if (history_stifled && (history_length == history_max_entries))
7576      {
7577        register int i;
7579        /* If the history is stifled, and history_length is zero,
7580 -        and it equals max_input_history, we don't save items. */
7581 +        and it equals history_max_entries, we don't save items. */
7582        if (history_length == 0)
7583         return;
7585 @@ -277,15 +276,15 @@ add_history (string)
7586  HIST_ENTRY *
7587  replace_history_entry (which, line, data)
7588       int which;
7589 -     char *line;
7590 +     const char *line;
7591       histdata_t data;
7593 -  HIST_ENTRY *temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
7594 -  HIST_ENTRY *old_value;
7595 +  HIST_ENTRY *temp, *old_value;
7597    if (which >= history_length)
7598      return ((HIST_ENTRY *)NULL);
7600 +  temp = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
7601    old_value = the_history[which];
7603    temp->line = savestring (line);
7604 @@ -303,12 +302,12 @@ remove_history (which)
7605       int which;
7607    HIST_ENTRY *return_value;
7608 +  register int i;
7610    if (which >= history_length || !history_length)
7611      return_value = (HIST_ENTRY *)NULL;
7612    else
7613      {
7614 -      register int i;
7615        return_value = the_history[which];
7617        for (i = which; i < history_length; i++)
7618 @@ -325,13 +324,13 @@ void
7619  stifle_history (max)
7620       int max;
7622 +  register int i, j;
7624    if (max < 0)
7625      max = 0;
7627    if (history_length > max)
7628      {
7629 -      register int i, j;
7631        /* This loses because we cannot free the data. */
7632        for (i = 0, j = history_length - max; i < j; i++)
7633         {
7634 @@ -347,7 +346,7 @@ stifle_history (max)
7635      }
7637    history_stifled = 1;
7638 -  max_input_history = max;
7639 +  max_input_history = history_max_entries = max;
7642  /* Stop stifling the history.  This returns the previous amount the 
7643 @@ -359,10 +358,10 @@ unstifle_history ()
7644    if (history_stifled)
7645      {
7646        history_stifled = 0;
7647 -      return (-max_input_history);
7648 +      return (-history_max_entries);
7649      }
7651 -  return (max_input_history);
7652 +  return (history_max_entries);
7655  int
7656 Index: readline/history.h
7657 ===================================================================
7658 RCS file: /prjz/.cvsroot/gdb/readline/history.h,v
7659 retrieving revision 1.1.1.1
7660 diff -u -3 -p -r1.1.1.1 history.h
7661 --- readline/history.h  2003/02/16 21:36:30     1.1.1.1
7662 +++ readline/history.h  2003/02/17 12:47:10
7663 @@ -22,24 +22,26 @@
7664  #ifndef _HISTORY_H_
7665  #define _HISTORY_H_
7667 +#if __READLINE_EXPORT__
7668 +# define READLINE_API __declspec (dllexport)
7669 +#elif __READLINE_IMPORT__
7670 +# define READLINE_API __declspec (dllimport)
7671 +#else
7672 +# define READLINE_API
7673 +#endif
7675  #ifdef __cplusplus
7676  extern "C" {
7677  #endif
7679  #if defined READLINE_LIBRARY
7680  #  include "rlstdc.h"
7681 +#  include "rltypedefs.h"
7682  #else
7683  #  include <readline/rlstdc.h>
7684 +#  include <readline/rltypedefs.h>
7685  #endif
7687 -#if !defined (_FUNCTION_DEF)
7688 -#  define _FUNCTION_DEF
7689 -typedef int Function ();
7690 -typedef void VFunction ();
7691 -typedef char *CPFunction ();
7692 -typedef char **CPPFunction ();
7693 -#endif
7695  #ifdef __STDC__
7696  typedef void *histdata_t;
7697  #else
7698 @@ -68,81 +70,81 @@ typedef struct _hist_state {
7700  /* Begin a session in which the history functions might be used.  This
7701     just initializes the interactive variables. */
7702 -extern void using_history __P((void));
7703 +READLINE_API extern void using_history __P((void));
7705  /* Return the current HISTORY_STATE of the history. */
7706 -extern HISTORY_STATE *history_get_history_state __P((void));
7707 +READLINE_API extern HISTORY_STATE *history_get_history_state __P((void));
7709  /* Set the state of the current history array to STATE. */
7710 -extern void history_set_history_state __P((HISTORY_STATE *));
7711 +READLINE_API extern void history_set_history_state __P((HISTORY_STATE *));
7713  /* Manage the history list. */
7715  /* Place STRING at the end of the history list.
7716     The associated data field (if any) is set to NULL. */
7717 -extern void add_history __P((char *));
7718 +READLINE_API extern void add_history __P((const char *));
7720  /* A reasonably useless function, only here for completeness.  WHICH
7721     is the magic number that tells us which element to delete.  The
7722     elements are numbered from 0. */
7723 -extern HIST_ENTRY *remove_history __P((int));
7724 +READLINE_API extern HIST_ENTRY *remove_history __P((int));
7726  /* Make the history entry at WHICH have LINE and DATA.  This returns
7727     the old entry so you can dispose of the data.  In the case of an
7728     invalid WHICH, a NULL pointer is returned. */
7729 -extern HIST_ENTRY *replace_history_entry __P((int, char *, histdata_t));
7730 +READLINE_API extern HIST_ENTRY *replace_history_entry __P((int, const char *, histdata_t));
7732  /* Clear the history list and start over. */
7733 -extern void clear_history __P((void));
7734 +READLINE_API extern void clear_history __P((void));
7736  /* Stifle the history list, remembering only MAX number of entries. */
7737 -extern void stifle_history __P((int));
7738 +READLINE_API extern void stifle_history __P((int));
7740  /* Stop stifling the history.  This returns the previous amount the
7741     history was stifled by.  The value is positive if the history was
7742     stifled, negative if it wasn't. */
7743 -extern int unstifle_history __P((void));
7744 +READLINE_API extern int unstifle_history __P((void));
7746  /* Return 1 if the history is stifled, 0 if it is not. */
7747 -extern int history_is_stifled __P((void));
7748 +READLINE_API extern int history_is_stifled __P((void));
7750  /* Information about the history list. */
7752  /* Return a NULL terminated array of HIST_ENTRY which is the current input
7753     history.  Element 0 of this list is the beginning of time.  If there
7754     is no history, return NULL. */
7755 -extern HIST_ENTRY **history_list __P((void));
7756 +READLINE_API extern HIST_ENTRY **history_list __P((void));
7758  /* Returns the number which says what history element we are now
7759     looking at.  */
7760 -extern int where_history __P((void));
7761 +READLINE_API extern int where_history __P((void));
7762    
7763  /* Return the history entry at the current position, as determined by
7764     history_offset.  If there is no entry there, return a NULL pointer. */
7765 -extern HIST_ENTRY *current_history __P((void));
7766 +READLINE_API extern HIST_ENTRY *current_history __P((void));
7768  /* Return the history entry which is logically at OFFSET in the history
7769     array.  OFFSET is relative to history_base. */
7770 -extern HIST_ENTRY *history_get __P((int));
7771 +READLINE_API extern HIST_ENTRY *history_get __P((int));
7773  /* Return the number of bytes that the primary history entries are using.
7774     This just adds up the lengths of the_history->lines. */
7775 -extern int history_total_bytes __P((void));
7776 +READLINE_API extern int history_total_bytes __P((void));
7778  /* Moving around the history list. */
7780  /* Set the position in the history list to POS. */
7781 -extern int history_set_pos __P((int));
7782 +READLINE_API extern int history_set_pos __P((int));
7784  /* Back up history_offset to the previous history entry, and return
7785     a pointer to that entry.  If there is no previous entry, return
7786     a NULL pointer. */
7787 -extern HIST_ENTRY *previous_history __P((void));
7788 +READLINE_API extern HIST_ENTRY *previous_history __P((void));
7790  /* Move history_offset forward to the next item in the input_history,
7791     and return the a pointer to that entry.  If there is no next entry,
7792     return a NULL pointer. */
7793 -extern HIST_ENTRY *next_history __P((void));
7794 +READLINE_API extern HIST_ENTRY *next_history __P((void));
7796  /* Searching the history list. */
7798 @@ -152,45 +154,45 @@ extern HIST_ENTRY *next_history __P((voi
7799     current_history () is the history entry, and the value of this function
7800     is the offset in the line of that history entry that the string was
7801     found in.  Otherwise, nothing is changed, and a -1 is returned. */
7802 -extern int history_search __P((char *, int));
7803 +READLINE_API extern int history_search __P((const char *, int));
7805  /* Search the history for STRING, starting at history_offset.
7806     The search is anchored: matching lines must begin with string.
7807     DIRECTION is as in history_search(). */
7808 -extern int history_search_prefix __P((char *, int));
7809 +READLINE_API extern int history_search_prefix __P((const char *, int));
7811  /* Search for STRING in the history list, starting at POS, an
7812     absolute index into the list.  DIR, if negative, says to search
7813     backwards from POS, else forwards.
7814     Returns the absolute index of the history element where STRING
7815     was found, or -1 otherwise. */
7816 -extern int history_search_pos __P((char *, int, int));
7817 +READLINE_API extern int history_search_pos __P((const char *, int, int));
7819  /* Managing the history file. */
7821  /* Add the contents of FILENAME to the history list, a line at a time.
7822     If FILENAME is NULL, then read from ~/.history.  Returns 0 if
7823     successful, or errno if not. */
7824 -extern int read_history __P((char *));
7825 +READLINE_API extern int read_history __P((const char *));
7827  /* Read a range of lines from FILENAME, adding them to the history list.
7828     Start reading at the FROM'th line and end at the TO'th.  If FROM
7829     is zero, start at the beginning.  If TO is less than FROM, read
7830     until the end of the file.  If FILENAME is NULL, then read from
7831     ~/.history.  Returns 0 if successful, or errno if not. */
7832 -extern int read_history_range __P((char *, int, int));
7833 +READLINE_API extern int read_history_range __P((const char *, int, int));
7835  /* Write the current history to FILENAME.  If FILENAME is NULL,
7836     then write the history list to ~/.history.  Values returned
7837     are as in read_history ().  */
7838 -extern int write_history __P((char *));
7839 +READLINE_API extern int write_history __P((const char *));
7841  /* Append NELEMENT entries to FILENAME.  The entries appended are from
7842     the end of the list minus NELEMENTs up to the end of the list. */
7843 -extern int append_history __P((int, char *));
7844 +READLINE_API extern int append_history __P((int, const char *));
7846  /* Truncate the history file, leaving only the last NLINES lines. */
7847 -extern int history_truncate_file __P((char *, int));
7848 +READLINE_API extern int history_truncate_file __P((const char *, int));
7850  /* History expansion. */
7852 @@ -206,12 +208,12 @@ extern int history_truncate_file __P((ch
7854    If an error ocurred in expansion, then OUTPUT contains a descriptive
7855    error message. */
7856 -extern int history_expand __P((char *, char **));
7857 +READLINE_API extern int history_expand __P((char *, char **));
7859  /* Extract a string segment consisting of the FIRST through LAST
7860     arguments present in STRING.  Arguments are broken up as in
7861     the shell. */
7862 -extern char *history_arg_extract __P((int, int, char *));
7863 +READLINE_API extern char *history_arg_extract __P((int, int, const char *));
7865  /* Return the text of the history event beginning at the current
7866     offset into STRING.  Pass STRING with *INDEX equal to the
7867 @@ -219,27 +221,31 @@ extern char *history_arg_extract __P((in
7868     DELIMITING_QUOTE is a character that is allowed to end the string
7869     specification for what to search for in addition to the normal
7870     characters `:', ` ', `\t', `\n', and sometimes `?'. */
7871 -extern char *get_history_event __P((char *, int *, int));
7872 +READLINE_API extern char *get_history_event __P((const char *, int *, int));
7874  /* Return an array of tokens, much as the shell might.  The tokens are
7875     parsed out of STRING. */
7876 -extern char **history_tokenize __P((char *));
7877 +READLINE_API extern char **history_tokenize __P((const char *));
7879  /* Exported history variables. */
7880 -extern int history_base;
7881 -extern int history_length;
7882 -extern int max_input_history;
7883 -extern char history_expansion_char;
7884 -extern char history_subst_char;
7885 -extern char history_comment_char;
7886 -extern char *history_no_expand_chars;
7887 -extern char *history_search_delimiter_chars;
7888 -extern int history_quotes_inhibit_expansion;
7889 +READLINE_API extern int history_base;
7890 +READLINE_API extern int history_length;
7891 +READLINE_API extern int history_max_entries;
7892 +READLINE_API extern char history_expansion_char;
7893 +READLINE_API extern char history_subst_char;
7894 +READLINE_API extern char *history_word_delimiters;
7895 +READLINE_API extern char history_comment_char;
7896 +READLINE_API extern char *history_no_expand_chars;
7897 +READLINE_API extern char *history_search_delimiter_chars;
7898 +READLINE_API extern int history_quotes_inhibit_expansion;
7900 +/* Backwards compatibility */
7901 +READLINE_API extern int max_input_history;
7903  /* If set, this function is called to decide whether or not a particular
7904     history expansion should be treated as a special case for the calling
7905     application and not expanded. */
7906 -extern Function *history_inhibit_expansion_function;
7907 +READLINE_API extern rl_linebuf_func_t *history_inhibit_expansion_function;
7909  #ifdef __cplusplus
7911 Index: readline/histsearch.c
7912 ===================================================================
7913 RCS file: /prjz/.cvsroot/gdb/readline/histsearch.c,v
7914 retrieving revision 1.1.1.1
7915 diff -u -3 -p -r1.1.1.1 histsearch.c
7916 --- readline/histsearch.c       2003/02/16 21:36:30     1.1.1.1
7917 +++ readline/histsearch.c       2000/09/28 18:15:52
7918 @@ -63,7 +63,7 @@ char *history_search_delimiter_chars = (
7920  static int
7921  history_search_internal (string, direction, anchored)
7922 -     char *string;
7923 +     const char *string;
7924       int direction, anchored;
7926    register int i, reverse;
7927 @@ -159,7 +159,7 @@ history_search_internal (string, directi
7928  /* Do a non-anchored search for STRING through the history in DIRECTION. */
7929  int
7930  history_search (string, direction)
7931 -     char *string;
7932 +     const char *string;
7933       int direction;
7935    return (history_search_internal (string, direction, NON_ANCHORED_SEARCH));
7936 @@ -168,7 +168,7 @@ history_search (string, direction)
7937  /* Do an anchored search for string through the history in DIRECTION. */
7938  int
7939  history_search_prefix (string, direction)
7940 -     char *string;
7941 +     const char *string;
7942       int direction;
7944    return (history_search_internal (string, direction, ANCHORED_SEARCH));
7945 @@ -179,7 +179,7 @@ history_search_prefix (string, direction
7946     which point to begin searching. */
7947  int
7948  history_search_pos (string, dir, pos)
7949 -     char *string;
7950 +     const char *string;
7951       int dir, pos;
7953    int ret, old;
7954 Index: readline/input.c
7955 ===================================================================
7956 RCS file: /prjz/.cvsroot/gdb/readline/input.c,v
7957 retrieving revision 1.1.1.1
7958 diff -u -3 -p -r1.1.1.1 input.c
7959 --- readline/input.c    2003/02/16 21:36:30     1.1.1.1
7960 +++ readline/input.c    2003/02/17 12:47:10
7961 @@ -78,10 +78,14 @@ extern int errno;
7963  /* Non-null means it is a pointer to a function to run while waiting for
7964     character input. */
7965 -Function *rl_event_hook = (Function *)NULL;
7966 +rl_hook_func_t *rl_event_hook = (rl_hook_func_t *)NULL;
7968 -Function *rl_getc_function = rl_getc;
7969 +rl_getc_func_t *rl_getc_function = rl_getc;
7971 +static int _keyboard_input_timeout = 100000;           /* 0.1 seconds; it's in usec */
7973 +static void rl_gather_tyi ();
7975  /* **************************************************************** */
7976  /*                                                                 */
7977  /*                     Character Input Buffering                   */
7978 @@ -147,6 +151,7 @@ rl_unget_char (key)
7979    return (0);
7982 +#ifndef __MINGW32__
7983  /* If a character is available to be read, then read it
7984     and stuff it into IBUFFER.  Otherwise, just return. */
7985  static void
7986 @@ -169,7 +174,7 @@ rl_gather_tyi ()
7987    FD_SET (tty, &readfds);
7988    FD_SET (tty, &exceptfds);
7989    timeout.tv_sec = 0;
7990 -  timeout.tv_usec = 100000;    /* 0.1 seconds */
7991 +  timeout.tv_usec = _keyboard_input_timeout;
7992    if (select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout) <= 0)
7993      return;    /* Nothing to read. */
7994  #endif
7995 @@ -222,6 +227,18 @@ rl_gather_tyi ()
7996      }
7999 +int
8000 +rl_set_keyboard_input_timeout (u)
8001 +     int u;
8003 +  int o;
8005 +  o = _keyboard_input_timeout;
8006 +  if (u > 0)
8007 +    _keyboard_input_timeout = u;
8008 +  return (o);
8011  /* Is there input available to be read on the readline input file
8012     descriptor?  Only works if the system has select(2) or FIONREAD. */
8013  int
8014 @@ -244,7 +261,7 @@ _rl_input_available ()
8015    FD_SET (tty, &readfds);
8016    FD_SET (tty, &exceptfds);
8017    timeout.tv_sec = 0;
8018 -  timeout.tv_usec = 100000;    /* 0.1 seconds */
8019 +  timeout.tv_usec = _keyboard_input_timeout;
8020    return (select (tty + 1, &readfds, (fd_set *)NULL, &exceptfds, &timeout) > 0);
8021  #endif
8023 @@ -255,6 +272,7 @@ _rl_input_available ()
8025    return 0;
8027 +#endif /* !__MINGW32__ */
8029  void
8030  _rl_insert_typein (c)
8031 @@ -293,6 +311,7 @@ rl_stuff_char (key)
8032      {
8033        key = NEWLINE;
8034        rl_pending_input = EOF;
8035 +      RL_SETSTATE (RL_STATE_INPUTPENDING);
8036      }
8037    ibuffer[push_index++] = key;
8038    if (push_index >= ibuffer_len)
8039 @@ -307,6 +326,16 @@ rl_execute_next (c)
8040       int c;
8042    rl_pending_input = c;
8043 +  RL_SETSTATE (RL_STATE_INPUTPENDING);
8044 +  return 0;
8047 +/* Clear any pending input pushed with rl_execute_next() */
8048 +int
8049 +rl_clear_pending_input ()
8051 +  rl_pending_input = 0;
8052 +  RL_UNSETSTATE (RL_STATE_INPUTPENDING);
8053    return 0;
8056 @@ -327,7 +356,7 @@ rl_read_key ()
8057    if (rl_pending_input)
8058      {
8059        c = rl_pending_input;
8060 -      rl_pending_input = 0;
8061 +      rl_clear_pending_input ();
8062      }
8063    else
8064      {
8065 @@ -341,6 +370,8 @@ rl_read_key ()
8066           while (rl_event_hook && rl_get_char (&c) == 0)
8067             {
8068               (*rl_event_hook) ();
8069 +             if (rl_done)              /* XXX - experimental */
8070 +               return ('\n');
8071               rl_gather_tyi ();
8072             }
8073         }
8074 @@ -354,6 +385,7 @@ rl_read_key ()
8075    return (c);
8078 +#ifndef __MINGW32__
8079  int
8080  rl_getc (stream)
8081       FILE *stream;
8082 @@ -392,7 +424,7 @@ rl_getc (stream)
8084        if (errno == X_EWOULDBLOCK || errno == X_EAGAIN)
8085         {
8086 -         if (unset_nodelay_mode (fileno (stream)) < 0)
8087 +         if (sh_unset_nodelay_mode (fileno (stream)) < 0)
8088             return (EOF);
8089           continue;
8090         }
8091 @@ -407,3 +439,198 @@ rl_getc (stream)
8092         return (EOF);
8093      }
8095 +#else /* __MINGW32__ */
8096 +#include <windows.h>
8097 +#include <ctype.h>
8098 +#include <conio.h>
8099 +#include <io.h>
8101 +#define EXT_PREFIX 0x1f8
8103 +#define KEV       irec.Event.KeyEvent                  /* to make life easier  */
8104 +#define KST       irec.Event.KeyEvent.dwControlKeyState
8107 +static int pending_key = 0;
8108 +static int pending_count = 0;
8109 +static int pending_prefix = 0;
8111 +extern int _rl_last_c_pos;     /* imported from display.c  */
8112 +extern int _rl_last_v_pos;
8113 +extern int rl_dispatching;     /* imported from readline.c  */
8114 +extern int rl_point;
8115 +extern int rl_done;
8116 +extern int rl_visible_prompt_length;
8117 +extern int _rl_screenwidth;            /* imported from terminal.c  */
8119 +extern int haveConsole;                /* imported from rltty.c  */
8120 +extern HANDLE hStdout, hStdin;
8121 +extern COORD rlScreenOrigin, rlScreenEnd;
8122 +extern int rlScreenStart, rlScreenMax;
8123 +static void MouseEventProc(MOUSE_EVENT_RECORD kev);
8125 +int rl_getc (stream)
8126 +     FILE *stream;
8128 +  int key;
8130 +  if ( pending_count )
8131 +    {
8132 +      --pending_count;
8133 +      if ( pending_prefix && (pending_count & 1) )
8134 +        return pending_prefix;
8135 +      else
8136 +        return pending_key;
8137 +    }
8139 +  while ( 1 )
8140 +    {
8141 +      DWORD dummy;
8143 +      if (WaitForSingleObject(hStdin, WAIT_FOR_INPUT) != WAIT_OBJECT_0)
8144 +        {
8145 +          if ( rl_done )
8146 +            return( 0 );
8147 +          else
8148 +            continue;
8149 +        }
8150 +      if ( haveConsole & FOR_INPUT )
8151 +        {
8152 +          INPUT_RECORD irec;
8153 +          ReadConsoleInput(hStdin, &irec, 1, &dummy);
8154 +          switch(irec.EventType)
8155 +            {
8156 +            case KEY_EVENT:
8157 +              if ( KEV.bKeyDown 
8158 +                  && ((KEV.wVirtualKeyCode < VK_SHIFT) || (KEV.wVirtualKeyCode > VK_MENU)) )
8159 +                {
8160 +                  int mask = 0;
8162 +                  key = KEV.uChar.AsciiChar & 0xff;
8163 +                  if ( KST & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED) )
8164 +                    mask=0x100;
8165 +                  if ( key )
8166 +                    {
8167 +                     /* Ascii direct */
8168 +                      pending_count = KEV.wRepeatCount - 1;
8169 +                      pending_key = key;
8170 +                      pending_prefix = 0;
8171 +                      if ( mask )
8172 +                        key = tolower(key) | mask;
8173 +                    }
8174 +                  else
8175 +                   /* Others prefixed */
8176 +                    {
8177 +                      key = EXT_PREFIX;
8178 +                      if ( mask )
8179 +                        key |= 4;
8180 +                      if (KST & SHIFT_PRESSED)
8181 +                        key |= 1;
8182 +                      if (KST & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
8183 +                        key |= 2;
8184 +                      mask |= EXT_PREFIX;
8185 +                      pending_count = (KEV.wRepeatCount << 1) - 1;
8186 +                      pending_key = KEV.wVirtualKeyCode;
8187 +                      pending_prefix = key;
8188 +                    }
8189 +                  return key;
8190 +                }
8191 +              break;
8192 +            case MOUSE_EVENT:
8193 +              if ( (haveConsole & FOR_OUTPUT) && !rl_dispatching )
8194 +                MouseEventProc(irec.Event.MouseEvent);
8195 +            default:
8196 +              break;
8197 +            }
8198 +        }
8199 +      else
8200 +        {
8201 +          ReadFile(hStdin, &key, 1, &dummy, NULL);
8202 +          return key;
8203 +        }
8204 +    }
8207 +void MouseEventProc(MOUSE_EVENT_RECORD mev)
8209 +  static DWORD lastButtonState, cstat_flags;
8210 +  static COORD lastButtonPos, src_down_pos;
8212 +#define RLPOS_CHANGED  1
8213 +#define SELECT_START   2
8214 +  
8215 +  switch (mev.dwEventFlags )
8216 +    {
8217 +    case 0 :                   /* change in button state  */
8219 +      /* Cursor setting: 
8220 +        LEFT_BUTTON_PRESSED sets cursor anywhere on the screen,
8221 +        thereafter, any change in button state will clipp the cursor
8222 +        position to the readline range if there has been no cursor
8223 +        movement. Otherwhise the cursor is reset to its old position.
8224 +      */
8225 +      if (mev.dwButtonState == FROM_LEFT_1ST_BUTTON_PRESSED)
8226 +        {
8227 +          if (lastButtonState == 0)
8228 +            {
8229 +              src_down_pos = mev.dwMousePosition;
8230 +              cstat_flags |= RLPOS_CHANGED | SELECT_START;
8231 +              SetConsoleCursorPosition(hStdout, mev.dwMousePosition);
8232 +            }
8233 +        }
8234 +      else
8235 +        {
8236 +          if (cstat_flags & RLPOS_CHANGED)
8237 +            {
8238 +              if ( (mev.dwMousePosition.X == src_down_pos.X)
8239 +                  && (mev.dwMousePosition.Y == src_down_pos.Y) )
8240 +                {
8241 +                  int linear_pos = (int)mev.dwMousePosition.Y * _rl_screenwidth
8242 +                   + (int)mev.dwMousePosition.X;
8243 +                  if (linear_pos < rlScreenStart + rl_visible_prompt_length)
8244 +                    {
8245 +                      linear_pos = rlScreenStart + rl_visible_prompt_length;
8246 +                      mev.dwMousePosition.X = rlScreenOrigin.X + rl_visible_prompt_length;
8247 +                      mev.dwMousePosition.Y = rlScreenOrigin.Y;
8248 +                    }
8249 +                  if (linear_pos > rlScreenMax)
8250 +                    {
8251 +                      linear_pos = rlScreenMax;
8252 +                      mev.dwMousePosition = rlScreenEnd;
8253 +                    }
8254 +                  rl_point = linear_pos - rlScreenStart - rl_visible_prompt_length;
8255 +                  _rl_last_c_pos = mev.dwMousePosition.X - rlScreenOrigin.X;
8256 +                  _rl_last_v_pos = mev.dwMousePosition.Y - rlScreenOrigin.Y;
8257 +                }
8258 +              else
8259 +                {
8260 +                  mev.dwMousePosition.X = rlScreenOrigin.X + _rl_last_c_pos;
8261 +                  mev.dwMousePosition.Y = rlScreenOrigin.Y + _rl_last_v_pos;
8262 +                }
8263 +              SetConsoleCursorPosition(hStdout, mev.dwMousePosition);
8264 +              cstat_flags &= !RLPOS_CHANGED;
8265 +            }
8266 +        }
8267 +      lastButtonState = mev.dwButtonState;
8268 +      lastButtonPos = mev.dwMousePosition;
8269 +      break;
8270 +    case MOUSE_MOVED:          /* the most frequent event */
8271 +    default:      
8272 +      break;
8273 +    }
8276 +int _rl_input_available ()
8278 +  if (isatty (fileno (rl_instream)))
8279 +    return (kbhit());
8280 +  return 0;
8283 +static void rl_gather_tyi ()
8285 +  while (isatty (fileno (rl_instream)) && kbhit () && ibuffer_space ())
8286 +    rl_stuff_char ((*rl_getc_function) (rl_instream));
8287 +  return;
8289 +#endif /* __MINGW32__ */
8290 Index: readline/isearch.c
8291 ===================================================================
8292 RCS file: /prjz/.cvsroot/gdb/readline/isearch.c,v
8293 retrieving revision 1.1.1.1
8294 diff -u -3 -p -r1.1.1.1 isearch.c
8295 --- readline/isearch.c  2003/02/16 21:36:31     1.1.1.1
8296 +++ readline/isearch.c  2001/02/14 12:37:01
8297 @@ -55,7 +55,7 @@
8298  unsigned char *_rl_isearch_terminators = (unsigned char *)NULL;
8300  /* Variables imported from other files in the readline library. */
8301 -extern HIST_ENTRY *saved_line_for_history;
8302 +extern HIST_ENTRY *_rl_saved_line_for_history;
8304  /* Forward declarations */
8305  static int rl_search_history __P((int, int));
8306 @@ -64,6 +64,8 @@ static int rl_search_history __P((int, i
8307     identical lines many times in a row. */
8308  static char *prev_line_found;
8310 +static unsigned char *default_isearch_terminators = "\033\012";
8312  /* Search backwards through the history looking for a string which is typed
8313     interactively.  Start with the current line. */
8314  int
8315 @@ -176,6 +178,7 @@ rl_search_history (direction, invoking_k
8316       been set, we use that value, otherwise we use ESC and C-J. */
8317    unsigned char *isearch_terminators;
8319 +  RL_SETSTATE(RL_STATE_ISEARCH);
8320    orig_point = rl_point;
8321    last_found_line = orig_line = where_history ();
8322    reverse = direction < 0;
8323 @@ -183,10 +186,10 @@ rl_search_history (direction, invoking_k
8324    allocated_line = (char *)NULL;
8326    isearch_terminators = _rl_isearch_terminators ? _rl_isearch_terminators
8327 -                                               : (unsigned char *)"\033\012";
8328 +                                               : default_isearch_terminators;
8330    /* Create an arrary of pointers to the lines that we want to search. */
8331 -  maybe_replace_line ();
8332 +  rl_maybe_replace_line ();
8333    i = 0;
8334    if (hlist)
8335      for (i = 0; hlist[i]; i++);
8336 @@ -197,8 +200,8 @@ rl_search_history (direction, invoking_k
8337    for (i = 0; i < hlen; i++)
8338      lines[i] = hlist[i]->line;
8340 -  if (saved_line_for_history)
8341 -    lines[i] = saved_line_for_history->line;
8342 +  if (_rl_saved_line_for_history)
8343 +    lines[i] = _rl_saved_line_for_history->line;
8344    else
8345      {
8346        /* Keep track of this so we can free it. */
8347 @@ -232,10 +235,12 @@ rl_search_history (direction, invoking_k
8348    found = failed = 0;
8349    for (;;)
8350      {
8351 -      Function *f = (Function *)NULL;
8352 +      rl_command_func_t *f = (rl_command_func_t *)NULL;
8354        /* Read a key and decide how to proceed. */
8355 +      RL_SETSTATE(RL_STATE_MOREINPUT);
8356        c = rl_read_key ();
8357 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
8359        if (_rl_keymap[c].type == ISFUNC)
8360         {
8361 @@ -273,6 +278,8 @@ rl_search_history (direction, invoking_k
8363        if (c >= 0 && (CTRL_CHAR (c) || META_CHAR (c) || c == RUBOUT) && c != CTRL ('G'))
8364         {
8365 +         /* This sets rl_pending_input to c; it will be picked up the next
8366 +            time rl_read_key is called. */
8367           rl_execute_next (c);
8368           break;
8369         }
8370 @@ -287,7 +294,7 @@ rl_search_history (direction, invoking_k
8371           else if (line_index != sline_len)
8372             ++line_index;
8373           else
8374 -           ding ();
8375 +           rl_ding ();
8376           break;
8378           /* switch directions */
8379 @@ -305,13 +312,14 @@ rl_search_history (direction, invoking_k
8380           if (allocated_line)
8381             free (allocated_line);
8382           free (lines);
8383 +         RL_UNSETSTATE(RL_STATE_ISEARCH);
8384           return 0;
8386  #if 0
8387         /* delete character from search string. */
8388         case -3:
8389           if (search_string_index == 0)
8390 -           ding ();
8391 +           rl_ding ();
8392           else
8393             {
8394               search_string[--search_string_index] = '\0';
8395 @@ -384,7 +392,7 @@ rl_search_history (direction, invoking_k
8396        if (failed)
8397         {
8398           /* We cannot find the search string.  Ding the bell. */
8399 -         ding ();
8400 +         rl_ding ();
8401           i = last_found_line;
8402           continue;             /* XXX - was break */
8403         }
8404 @@ -437,6 +445,8 @@ rl_search_history (direction, invoking_k
8405    if (allocated_line)
8406      free (allocated_line);
8407    free (lines);
8409 +  RL_UNSETSTATE(RL_STATE_ISEARCH);
8411    return 0;
8413 Index: readline/keymaps.c
8414 ===================================================================
8415 RCS file: /prjz/.cvsroot/gdb/readline/keymaps.c,v
8416 retrieving revision 1.1.1.1
8417 diff -u -3 -p -r1.1.1.1 keymaps.c
8418 --- readline/keymaps.c  2003/02/16 21:36:31     1.1.1.1
8419 +++ readline/keymaps.c  2000/10/30 17:05:43
8420 @@ -61,7 +61,7 @@ rl_make_bare_keymap ()
8421    for (i = 0; i < KEYMAP_SIZE; i++)
8422      {
8423        keymap[i].type = ISFUNC;
8424 -      keymap[i].function = (Function *)NULL;
8425 +      keymap[i].function = (rl_command_func_t *)NULL;
8426      }
8428    for (i = 'A'; i < ('Z' + 1); i++)
8429 Index: readline/keymaps.h
8430 ===================================================================
8431 RCS file: /prjz/.cvsroot/gdb/readline/keymaps.h,v
8432 retrieving revision 1.1.1.1
8433 diff -u -3 -p -r1.1.1.1 keymaps.h
8434 --- readline/keymaps.h  2003/02/16 21:36:31     1.1.1.1
8435 +++ readline/keymaps.h  2003/02/17 12:47:10
8436 @@ -23,6 +23,14 @@
8437  #ifndef _KEYMAPS_H_
8438  #define _KEYMAPS_H_
8440 +#if __READLINE_EXPORT__
8441 +# define READLINE_API __declspec (dllexport)
8442 +#elif __READLINE_IMPORT__
8443 +# define READLINE_API __declspec (dllimport)
8444 +#else
8445 +# define READLINE_API
8446 +#endif
8448  #ifdef __cplusplus
8449  extern "C" {
8450  #endif
8451 @@ -30,17 +38,11 @@ extern "C" {
8452  #if defined (READLINE_LIBRARY)
8453  #  include "rlstdc.h"
8454  #  include "chardefs.h"
8455 +#  include "rltypedefs.h"
8456  #else
8457  #  include <readline/rlstdc.h>
8458  #  include <readline/chardefs.h>
8459 -#endif
8461 -#if !defined (_FUNCTION_DEF)
8462 -#  define _FUNCTION_DEF
8463 -typedef int Function ();
8464 -typedef void VFunction ();
8465 -typedef char *CPFunction ();
8466 -typedef char **CPPFunction ();
8467 +#  include <readline/rltypedefs.h>
8468  #endif
8470  /* A keymap contains one entry for each key in the ASCII set.
8471 @@ -50,7 +52,7 @@ typedef char **CPPFunction ();
8472     TYPE says which kind of thing FUNCTION is. */
8473  typedef struct _keymap_entry {
8474    char type;
8475 -  Function *function;
8476 +  rl_command_func_t *function;
8477  } KEYMAP_ENTRY;
8479  /* This must be large enough to hold bindings for all of the characters
8480 @@ -59,7 +61,7 @@ typedef struct _keymap_entry {
8481  #define KEYMAP_SIZE 256
8483  /* I wanted to make the above structure contain a union of:
8484 -   union { Function *function; struct _keymap_entry *keymap; } value;
8485 +   union { rl_command_func_t *function; struct _keymap_entry *keymap; } value;
8486     but this made it impossible for me to create a static array.
8487     Maybe I need C lessons. */
8489 @@ -71,35 +73,35 @@ typedef KEYMAP_ENTRY *Keymap;
8490  #define ISKMAP 1
8491  #define ISMACR 2
8493 -extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
8494 -extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
8495 +READLINE_API extern KEYMAP_ENTRY_ARRAY emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap;
8496 +READLINE_API extern KEYMAP_ENTRY_ARRAY vi_insertion_keymap, vi_movement_keymap;
8498  /* Return a new, empty keymap.
8499     Free it with free() when you are done. */
8500 -extern Keymap rl_make_bare_keymap __P((void));
8501 +READLINE_API extern Keymap rl_make_bare_keymap __P((void));
8503  /* Return a new keymap which is a copy of MAP. */
8504 -extern Keymap rl_copy_keymap __P((Keymap));
8505 +READLINE_API extern Keymap rl_copy_keymap __P((Keymap));
8507  /* Return a new keymap with the printing characters bound to rl_insert,
8508     the lowercase Meta characters bound to run their equivalents, and
8509     the Meta digits bound to produce numeric arguments. */
8510 -extern Keymap rl_make_keymap __P((void));
8511 +READLINE_API extern Keymap rl_make_keymap __P((void));
8513  /* Free the storage associated with a keymap. */
8514 -extern void rl_discard_keymap __P((Keymap));
8515 +READLINE_API extern void rl_discard_keymap __P((Keymap));
8517  /* These functions actually appear in bind.c */
8519  /* Return the keymap corresponding to a given name.  Names look like
8520     `emacs' or `emacs-meta' or `vi-insert'.  */
8521 -extern Keymap rl_get_keymap_by_name __P((char *));
8522 +READLINE_API extern Keymap rl_get_keymap_by_name __P((const char *));
8524  /* Return the current keymap. */
8525 -extern Keymap rl_get_keymap __P((void));
8526 +READLINE_API extern Keymap rl_get_keymap __P((void));
8528  /* Set the current keymap to MAP. */
8529 -extern void rl_set_keymap __P((Keymap));
8530 +READLINE_API extern void rl_set_keymap __P((Keymap));
8532  #ifdef __cplusplus
8534 Index: readline/kill.c
8535 ===================================================================
8536 RCS file: /prjz/.cvsroot/gdb/readline/kill.c,v
8537 retrieving revision 1.1.1.1
8538 diff -u -3 -p -r1.1.1.1 kill.c
8539 --- readline/kill.c     2003/02/16 21:36:31     1.1.1.1
8540 +++ readline/kill.c     2003/02/17 12:47:10
8541 @@ -264,7 +264,7 @@ rl_backward_kill_line (direction, ignore
8542    else
8543      {
8544        if (!rl_point)
8545 -       ding ();
8546 +       rl_ding ();
8547        else
8548         {
8549           rl_beg_of_line (1, ignore);
8550 @@ -299,7 +299,7 @@ rl_unix_word_rubout (count, key)
8551    int orig_point;
8553    if (rl_point == 0)
8554 -    ding ();
8555 +    rl_ding ();
8556    else
8557      {
8558        orig_point = rl_point;
8559 @@ -331,7 +331,7 @@ rl_unix_line_discard (count, key)
8560       int count, key;
8562    if (rl_point == 0)
8563 -    ding ();
8564 +    rl_ding ();
8565    else
8566      {
8567        rl_kill_text (rl_point, 0);
8568 @@ -512,14 +512,14 @@ rl_yank_nth_arg_internal (count, ignore,
8570    if (entry == 0)
8571      {
8572 -      ding ();
8573 +      rl_ding ();
8574        return -1;
8575      }
8577    arg = history_arg_extract (count, count, entry->line);
8578    if (!arg || !*arg)
8579      {
8580 -      ding ();
8581 +      rl_ding ();
8582        return -1;
8583      }
8585 @@ -592,7 +592,7 @@ rl_yank_last_arg (count, key)
8588  /* A special paste command for users of Cygnus's cygwin32. */
8589 -#if defined (__CYGWIN32__)
8590 +#if defined (__CYGWIN__) || defined (__MINGW32__)
8591  #include <windows.h>
8593  int
8594 @@ -625,4 +625,4 @@ rl_paste_from_clipboard (count, key)
8595      }
8596    return (0);
8598 -#endif /* __CYGWIN32__ */
8599 +#endif /* __CYGWIN__ */
8600 Index: readline/macro.c
8601 ===================================================================
8602 RCS file: /prjz/.cvsroot/gdb/readline/macro.c,v
8603 retrieving revision 1.1.1.1
8604 diff -u -3 -p -r1.1.1.1 macro.c
8605 --- readline/macro.c    2003/02/16 21:36:31     1.1.1.1
8606 +++ readline/macro.c    2000/11/02 17:36:37
8607 @@ -57,12 +57,12 @@
8608  /*                                                                 */
8609  /* **************************************************************** */
8611 -/* Non-zero means to save keys that we dispatch on in a kbd macro. */
8612 -int _rl_defining_kbd_macro = 0;
8614  /* The currently executing macro string.  If this is non-zero,
8615     then it is a malloc ()'ed string where input is coming from. */
8616 -char *_rl_executing_macro = (char *)NULL;
8617 +char *rl_executing_macro = (char *)NULL;
8619 +/* Non-zero means to save keys that we dispatch on in a kbd macro. */
8620 +int _rl_defining_kbd_macro = 0;
8622  /* The offset in the above string to the next character to be read. */
8623  static int executing_macro_index;
8624 @@ -95,8 +95,9 @@ _rl_with_macro_input (string)
8625       char *string;
8627    _rl_push_executing_macro ();
8628 -  _rl_executing_macro = string;
8629 +  rl_executing_macro = string;
8630    executing_macro_index = 0;
8631 +  RL_SETSTATE(RL_STATE_MACROINPUT);
8634  /* Return the next character available from a macro, or 0 if
8635 @@ -104,16 +105,16 @@ _rl_with_macro_input (string)
8636  int
8637  _rl_next_macro_key ()
8639 -  if (_rl_executing_macro == 0)
8640 +  if (rl_executing_macro == 0)
8641      return (0);
8643 -  if (_rl_executing_macro[executing_macro_index] == 0)
8644 +  if (rl_executing_macro[executing_macro_index] == 0)
8645      {
8646        _rl_pop_executing_macro ();
8647        return (_rl_next_macro_key ());
8648      }
8650 -  return (_rl_executing_macro[executing_macro_index++]);
8651 +  return (rl_executing_macro[executing_macro_index++]);
8654  /* Save the currently executing macro on a stack of saved macros. */
8655 @@ -125,7 +126,7 @@ _rl_push_executing_macro ()
8656    saver = (struct saved_macro *)xmalloc (sizeof (struct saved_macro));
8657    saver->next = macro_list;
8658    saver->sindex = executing_macro_index;
8659 -  saver->string = _rl_executing_macro;
8660 +  saver->string = rl_executing_macro;
8662    macro_list = saver;
8664 @@ -136,21 +137,22 @@ void
8665  _rl_pop_executing_macro ()
8667    struct saved_macro *macro;
8669 -  if (_rl_executing_macro)
8670 -    free (_rl_executing_macro);
8672 -  _rl_executing_macro = (char *)NULL;
8673 +  FREE (rl_executing_macro);
8674 +  rl_executing_macro = (char *)NULL;
8675    executing_macro_index = 0;
8677    if (macro_list)
8678      {
8679        macro = macro_list;
8680 -      _rl_executing_macro = macro_list->string;
8681 +      rl_executing_macro = macro_list->string;
8682        executing_macro_index = macro_list->sindex;
8683        macro_list = macro_list->next;
8684        free (macro);
8685      }
8687 +  if (rl_executing_macro == 0)
8688 +    RL_UNSETSTATE(RL_STATE_MACROINPUT);
8691  /* Add a character to the macro being built. */
8692 @@ -180,14 +182,12 @@ _rl_kill_kbd_macro ()
8693      }
8694    current_macro_size = current_macro_index = 0;
8696 -  if (_rl_executing_macro)
8697 -    {
8698 -      free (_rl_executing_macro);
8699 -      _rl_executing_macro = (char *) NULL;
8700 -    }
8701 +  FREE (rl_executing_macro);
8702 +  rl_executing_macro = (char *) NULL;
8703    executing_macro_index = 0;
8705    _rl_defining_kbd_macro = 0;
8706 +  RL_UNSETSTATE(RL_STATE_MACRODEF);
8709  /* Begin defining a keyboard macro.
8710 @@ -215,6 +215,7 @@ rl_start_kbd_macro (ignore1, ignore2)
8711      current_macro_index = 0;
8713    _rl_defining_kbd_macro = 1;
8714 +  RL_SETSTATE(RL_STATE_MACRODEF);
8715    return 0;
8718 @@ -235,6 +236,7 @@ rl_end_kbd_macro (count, ignore)
8719    current_macro[current_macro_index] = '\0';
8721    _rl_defining_kbd_macro = 0;
8722 +  RL_UNSETSTATE(RL_STATE_MACRODEF);
8724    return (rl_call_last_kbd_macro (--count, 0));
8726 @@ -250,7 +252,7 @@ rl_call_last_kbd_macro (count, ignore)
8728    if (_rl_defining_kbd_macro)
8729      {
8730 -      ding ();         /* no recursive macros */
8731 +      rl_ding ();              /* no recursive macros */
8732        current_macro[--current_macro_index] = '\0';     /* erase this char */
8733        return 0;
8734      }
8735 Index: readline/nls.c
8736 ===================================================================
8737 RCS file: /prjz/.cvsroot/gdb/readline/nls.c,v
8738 retrieving revision 1.1.1.1
8739 diff -u -3 -p -r1.1.1.1 nls.c
8740 --- readline/nls.c      2003/02/16 21:36:31     1.1.1.1
8741 +++ readline/nls.c      2000/11/03 16:44:27
8742 @@ -105,9 +105,9 @@ _rl_init_eightbit ()
8743    /* We don't have setlocale.  Finesse it.  Check the environment for the
8744       appropriate variables and set eight-bit mode if they have the right
8745       values. */
8746 -  lspec = get_env_value ("LC_ALL");
8747 -  if (lspec == 0) lspec = get_env_value ("LC_CTYPE");
8748 -  if (lspec == 0) lspec = get_env_value ("LANG");
8749 +  lspec = sh_get_env_value ("LC_ALL");
8750 +  if (lspec == 0) lspec = sh_get_env_value ("LC_CTYPE");
8751 +  if (lspec == 0) lspec = sh_get_env_value ("LANG");
8752    if (lspec == 0 || (t = normalize_codeset (lspec)) == 0)
8753      return (0);
8754    for (i = 0; t && legal_lang_values[i]; i++)
8755 Index: readline/parens.c
8756 ===================================================================
8757 RCS file: /prjz/.cvsroot/gdb/readline/parens.c,v
8758 retrieving revision 1.1.1.1
8759 diff -u -3 -p -r1.1.1.1 parens.c
8760 --- readline/parens.c   2003/02/16 21:36:31     1.1.1.1
8761 +++ readline/parens.c   2003/02/17 12:47:10
8762 @@ -34,6 +34,10 @@
8763  #  define HAVE_SELECT
8764  #endif
8766 +#ifdef __MINGW32__
8767 +# include <windows.h>
8768 +#endif
8770  #if defined (HAVE_SELECT)
8771  #  include <sys/time.h>
8772  #endif /* HAVE_SELECT */
8773 @@ -58,12 +62,14 @@ static int find_matching_open __P((char 
8775  /* Non-zero means try to blink the matching open parenthesis when the
8776     close parenthesis is inserted. */
8777 -#if defined (HAVE_SELECT)
8778 +#if defined (HAVE_SELECT) || defined (__MINGW32__)
8779  int rl_blink_matching_paren = 1;
8780  #else /* !HAVE_SELECT */
8781  int rl_blink_matching_paren = 0;
8782  #endif /* !HAVE_SELECT */
8784 +static int _paren_blink_usec = 500000;
8786  /* Change emacs_standard_keymap to have bindings for paren matching when
8787     ON_OR_OFF is 1, change them back to self_insert when ON_OR_OFF == 0. */
8788  void
8789 @@ -85,6 +91,18 @@ _rl_enable_paren_matching (on_or_off)
8792  int
8793 +rl_set_paren_blink_timeout (u)
8794 +     int u;
8796 +  int o;
8798 +  o = _paren_blink_usec;
8799 +  if (u > 0)
8800 +    _paren_blink_usec = u;
8801 +  return (o);
8804 +int
8805  rl_insert_close (count, invoking_key)
8806       int count, invoking_key;
8808 @@ -109,14 +127,31 @@ rl_insert_close (count, invoking_key)
8809        FD_ZERO (&readfds);
8810        FD_SET (fileno (rl_instream), &readfds);
8811        timer.tv_sec = 0;
8812 -      timer.tv_usec = 500000;
8813 +      timer.tv_usec = _paren_blink_usec;
8815        orig_point = rl_point;
8816        rl_point = match_point;
8817        (*rl_redisplay_function) ();
8818        ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
8819        rl_point = orig_point;
8820 -#else /* !HAVE_SELECT */
8821 +#elif defined (__MINGW32__)
8822 +      int orig_point, match_point, ready;
8824 +      rl_insert (1, invoking_key);
8825 +      (*rl_redisplay_function) ();
8826 +      match_point =
8827 +       find_matching_open (rl_line_buffer, rl_point - 2, invoking_key);
8829 +      /* Emacs might message or ring the bell here, but I don't. */
8830 +      if (match_point < 0)
8831 +       return -1;
8833 +      orig_point = rl_point;
8834 +      rl_point = match_point;
8835 +      (*rl_redisplay_function) ();
8836 +      ready = (WaitForSingleObject (GetStdHandle(STD_INPUT_HANDLE), 500) == WAIT_OBJECT_0);
8837 +      rl_point = orig_point;
8838 +#else /* !__MINGW32__ */
8839        rl_insert (count, invoking_key);
8840  #endif /* !HAVE_SELECT */
8841      }
8842 Index: readline/posixdir.h
8843 ===================================================================
8844 RCS file: /prjz/.cvsroot/gdb/readline/posixdir.h,v
8845 retrieving revision 1.1.1.1
8846 diff -u -3 -p -r1.1.1.1 posixdir.h
8847 --- readline/posixdir.h 2003/02/16 21:36:31     1.1.1.1
8848 +++ readline/posixdir.h 2003/02/17 12:47:10
8849 @@ -26,6 +26,7 @@
8850  #if defined (HAVE_DIRENT_H)
8851  #  include <dirent.h>
8852  #  define D_NAMLEN(d)   (strlen ((d)->d_name))
8853 +#  define FILENAME(d)   ((d)->d_name)
8854  #else
8855  #  if defined (HAVE_SYS_NDIR_H)
8856  #    include <sys/ndir.h>
8857 @@ -40,7 +41,16 @@
8858  #    define dirent direct
8859  #  endif /* !dirent */
8860  #  define D_NAMLEN(d)   ((d)->d_namlen)
8861 +#  define FILENAME(d)   ((d)->d_name)
8862  #endif /* !HAVE_DIRENT_H */
8864 +#ifdef __MINGW32__
8865 +# undef FILENAME
8866 +# define FILENAME(d) (d).cFileName
8867 +# define closedir(dir) FindClose (dir)
8868 +# undef D_NAMLEN
8869 +# define D_NAMLEN(d) strlen (d.cFileName)
8870 +#endif
8872  #if defined (STRUCT_DIRENT_HAS_D_INO) && !defined (STRUCT_DIRENT_HAS_D_FILENO)
8873  #  define d_fileno d_ino
8874 Index: readline/readline.c
8875 ===================================================================
8876 RCS file: /prjz/.cvsroot/gdb/readline/readline.c,v
8877 retrieving revision 1.1.1.1
8878 diff -u -3 -p -r1.1.1.1 readline.c
8879 --- readline/readline.c 2003/02/16 21:36:31     1.1.1.1
8880 +++ readline/readline.c 2003/02/17 12:47:10
8881 @@ -67,7 +67,7 @@
8882  #include "xmalloc.h"
8884  #ifndef RL_LIBRARY_VERSION
8885 -#  define RL_LIBRARY_VERSION "4.1"
8886 +#  define RL_LIBRARY_VERSION "4.2"
8887  #endif
8889  /* Evaluates its arguments multiple times. */
8890 @@ -90,8 +90,9 @@ static void readline_default_bindings __
8891  /*                                                                 */
8892  /* **************************************************************** */
8894 -char *rl_library_version = RL_LIBRARY_VERSION;
8895 +const char *rl_library_version = RL_LIBRARY_VERSION;
8897 +/* True if this is `real' readline as opposed to some stub substitute. */
8898  int rl_gnu_readline_p = 1;
8900  /* A pointer to the keymap that is currently in use.
8901 @@ -121,8 +122,13 @@ int rl_arg_sign = 1;
8902  /* Non-zero means we have been called at least once before. */
8903  static int rl_initialized;
8905 +#if 0
8906  /* If non-zero, this program is running in an EMACS buffer. */
8907  static int running_in_emacs;
8908 +#endif
8910 +/* Flags word encapsulating the current readline state. */
8911 +int rl_readline_state = RL_STATE_NONE;
8913  /* The current offset in the current input line. */
8914  int rl_point;
8915 @@ -137,7 +143,7 @@ int rl_end;
8916  int rl_done;
8918  /* The last function executed by readline. */
8919 -Function *rl_last_func = (Function *)NULL;
8920 +rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL;
8922  /* Top level environment for readline_internal (). */
8923  procenv_t readline_top_level;
8924 @@ -153,7 +159,7 @@ FILE *rl_outstream = (FILE *)NULL;
8925  int readline_echoing_p = 1;
8927  /* Current prompt. */
8928 -char *rl_prompt;
8929 +char *rl_prompt = (char *)NULL;
8930  int rl_visible_prompt_length = 0;
8932  /* Set to non-zero by calling application if it has already printed rl_prompt
8933 @@ -165,12 +171,12 @@ int rl_key_sequence_length = 0;
8935  /* If non-zero, then this is the address of a function to call just
8936     before readline_internal_setup () prints the first prompt. */
8937 -Function *rl_startup_hook = (Function *)NULL;
8938 +rl_hook_func_t *rl_startup_hook = (rl_hook_func_t *)NULL;
8940  /* If non-zero, this is the address of a function to call just before
8941     readline_internal_setup () returns and readline_internal starts
8942     reading input characters. */
8943 -Function *rl_pre_input_hook = (Function *)NULL;
8944 +rl_hook_func_t *rl_pre_input_hook = (rl_hook_func_t *)NULL;
8946  /* What we use internally.  You should always refer to RL_LINE_BUFFER. */
8947  static char *the_line;
8948 @@ -183,7 +189,7 @@ int _rl_eof_char = CTRL ('D');
8949  int rl_pending_input = 0;
8951  /* Pointer to a useful terminal name. */
8952 -char *rl_terminal_name = (char *)NULL;
8953 +const char *rl_terminal_name = (const char *)NULL;
8955  /* Non-zero means to always use horizontal scrolling in line display. */
8956  int _rl_horizontal_scroll_mode = 0;
8957 @@ -243,24 +249,37 @@ int _rl_output_meta_chars = 0;
8958  /* Non-zero means treat 0200 bit in terminal input as Meta bit. */
8959  int _rl_meta_flag = 0; /* Forward declaration */
8961 +/* Set up the prompt and expand it.  Called from readline() and
8962 +   rl_callback_handler_install (). */
8963 +int
8964 +rl_set_prompt (prompt)
8965 +     const char *prompt;
8967 +  FREE (rl_prompt);
8968 +  rl_prompt = prompt ? savestring (prompt) : (char *)NULL;
8970 +  rl_visible_prompt_length = (rl_prompt && *rl_prompt)
8971 +                               ? rl_expand_prompt (rl_prompt)
8972 +                               : 0;
8973 +  return 0;
8975 +  
8976  /* Read a line of input.  Prompt with PROMPT.  An empty PROMPT means
8977     none.  A return value of NULL means that EOF was encountered. */
8978  char *
8979  readline (prompt)
8980 -     char *prompt;
8981 +     const char *prompt;
8983    char *value;
8985 -  rl_prompt = prompt;
8987    /* If we are at EOF return a NULL string. */
8988    if (rl_pending_input == EOF)
8989      {
8990 -      rl_pending_input = 0;
8991 +      rl_clear_pending_input ();
8992        return ((char *)NULL);
8993      }
8995 -  rl_visible_prompt_length = rl_expand_prompt (rl_prompt);
8996 +  rl_set_prompt (prompt);
8998    rl_initialize ();
8999    (*rl_prep_term_function) (_rl_meta_flag);
9000 @@ -348,7 +367,7 @@ readline_internal_teardown (eof)
9001    /* At any rate, it is highly likely that this line has an undo list.  Get
9002       rid of it now. */
9003    if (rl_undo_list)
9004 -    free_undo_list ();
9005 +    rl_free_undo_list ();
9007    return (eof ? (char *)NULL : savestring (the_line));
9009 @@ -384,7 +403,9 @@ readline_internal_charloop ()
9010           rl_key_sequence_length = 0;
9011         }
9013 +      RL_SETSTATE(RL_STATE_READCMD);
9014        c = rl_read_key ();
9015 +      RL_UNSETSTATE(RL_STATE_READCMD);
9017        /* EOF typed to a non-blank line is a <NL>. */
9018        if (c == EOF && rl_end)
9019 @@ -395,6 +416,7 @@ readline_internal_charloop ()
9020        if (((c == _rl_eof_char && lastc != c) || c == EOF) && !rl_end)
9021         {
9022  #if defined (READLINE_CALLBACKS)
9023 +         RL_SETSTATE(RL_STATE_DONE);
9024           return (rl_done = 1);
9025  #else
9026           eof_found = 1;
9027 @@ -403,7 +425,7 @@ readline_internal_charloop ()
9028         }
9030        lastc = c;
9031 -      _rl_dispatch ((unsigned char)c, _rl_keymap);
9032 +      _rl_dispatch (c, _rl_keymap);
9034        /* If there was no change in _rl_last_command_was_kill, then no kill
9035          has taken place.  Note that if input is pending we are reading
9036 @@ -491,7 +513,7 @@ _rl_dispatch (key, map)
9038    int r, newkey;
9039    char *macro;
9040 -  Function *func;
9041 +  rl_command_func_t *func;
9043    if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii)
9044      {
9045 @@ -505,7 +527,7 @@ _rl_dispatch (key, map)
9046           return (_rl_dispatch (key, map));
9047         }
9048        else
9049 -       ding ();
9050 +       rl_ding ();
9051        return 0;
9052      }
9054 @@ -517,7 +539,7 @@ _rl_dispatch (key, map)
9055      {
9056      case ISFUNC:
9057        func = map[key].function;
9058 -      if (func != (Function *)NULL)
9059 +      if (func)
9060         {
9061           /* Special case rl_do_lowercase_version (). */
9062           if (func == rl_do_lowercase_version)
9063 @@ -530,13 +552,15 @@ _rl_dispatch (key, map)
9064  #endif
9066           rl_dispatching = 1;
9067 +         RL_SETSTATE(RL_STATE_DISPATCHING);
9068           r = (*map[key].function)(rl_numeric_arg * rl_arg_sign, key);
9069 +         RL_UNSETSTATE(RL_STATE_DISPATCHING);
9070           rl_dispatching = 0;
9072           /* If we have input pending, then the last command was a prefix
9073              command.  Don't change the state of rl_last_func.  Otherwise,
9074              remember the last command executed in this variable. */
9075 -         if (!rl_pending_input && map[key].function != rl_digit_argument)
9076 +         if (rl_pending_input == 0 && map[key].function != rl_digit_argument)
9077             rl_last_func = map[key].function;
9078         }
9079        else
9080 @@ -547,10 +571,18 @@ _rl_dispatch (key, map)
9081        break;
9083      case ISKMAP:
9084 -      if (map[key].function != (Function *)NULL)
9085 +      if (map[key].function != 0)
9086         {
9087           rl_key_sequence_length++;
9089 +         if (key == ESC)
9090 +           RL_SETSTATE(RL_STATE_METANEXT);
9091 +         RL_SETSTATE(RL_STATE_MOREINPUT);
9092           newkey = rl_read_key ();
9093 +         RL_UNSETSTATE(RL_STATE_MOREINPUT);
9094 +         if (key == ESC)
9095 +           RL_UNSETSTATE(RL_STATE_METANEXT);
9097           r = _rl_dispatch (newkey, FUNCTION_TO_KEYMAP (map, key));
9098         }
9099        else
9100 @@ -561,7 +593,7 @@ _rl_dispatch (key, map)
9101        break;
9103      case ISMACR:
9104 -      if (map[key].function != (Function *)NULL)
9105 +      if (map[key].function != 0)
9106         {
9107           macro = savestring ((char *)map[key].function);
9108           _rl_with_macro_input (macro);
9109 @@ -591,8 +623,11 @@ rl_initialize ()
9110       terminal and data structures. */
9111    if (!rl_initialized)
9112      {
9113 +      RL_SETSTATE(RL_STATE_INITIALIZING);
9114        readline_initialize_everything ();
9115 +      RL_UNSETSTATE(RL_STATE_INITIALIZING);
9116        rl_initialized++;
9117 +      RL_SETSTATE(RL_STATE_INITIALIZED);
9118      }
9120    /* Initalize the current line information. */
9121 @@ -600,6 +635,7 @@ rl_initialize ()
9123    /* We aren't done yet.  We haven't even gotten started yet! */
9124    rl_done = 0;
9125 +  RL_UNSETSTATE(RL_STATE_DONE);
9127    /* Tell the history routines what is going on. */
9128    start_using_history ();
9129 @@ -608,7 +644,7 @@ rl_initialize ()
9130    rl_reset_line_state ();
9132    /* No such function typed yet. */
9133 -  rl_last_func = (Function *)NULL;
9134 +  rl_last_func = (rl_command_func_t *)NULL;
9136    /* Parsing of key-bindings begins in an enabled state. */
9137    _rl_parsing_conditionalized_out = 0;
9138 @@ -658,8 +694,10 @@ readline_initialize_everything ()
9139  #endif
9140  #endif
9142 -  /* Find out if we are running in Emacs. */
9143 -  running_in_emacs = get_env_value ("EMACS") != (char *)0;
9144 +#if 0
9145 +  /* Find out if we are running in Emacs -- UNUSED. */
9146 +  running_in_emacs = sh_get_env_value ("EMACS") != (char *)0;
9147 +#endif
9149    /* Set up input and output if they are not already set up. */
9150    if (!rl_instream)
9151 @@ -679,7 +717,9 @@ readline_initialize_everything ()
9152      rl_line_buffer = xmalloc (rl_line_buffer_len = DEFAULT_BUFFER_SIZE);
9154    /* Initialize the terminal interface. */
9155 -  _rl_init_terminal_io ((char *)NULL);
9156 +  if (rl_terminal_name == 0)
9157 +    rl_terminal_name = sh_get_env_value ("TERM");
9158 +  _rl_init_terminal_io (rl_terminal_name);
9160    /* Bind tty characters to readline functions. */
9161    readline_default_bindings ();
9162 @@ -696,16 +736,18 @@ readline_initialize_everything ()
9163    /* XXX */
9164    if (_rl_horizontal_scroll_mode && _rl_term_autowrap)
9165      {
9166 -      screenwidth--;
9167 -      screenchars -= screenheight;
9168 +      _rl_screenwidth--;
9169 +      _rl_screenchars -= _rl_screenheight;
9170      }
9172    /* Override the effect of any `set keymap' assignments in the
9173       inputrc file. */
9174    rl_set_keymap_from_edit_mode ();
9176 +#ifndef __MINGW32__
9177    /* Try to bind a common arrow key prefix, if not already bound. */
9178    bind_arrow_keys ();
9179 +#endif
9181    /* Enable the meta key, if this terminal has one. */
9182    if (_rl_enable_meta)
9183 @@ -723,13 +765,14 @@ readline_initialize_everything ()
9184  static void
9185  readline_default_bindings ()
9187 -  rltty_set_default_bindings (_rl_keymap);
9188 +  rl_tty_set_default_bindings (_rl_keymap);
9191 +#ifndef __MINGW32__
9192  static void
9193  bind_arrow_keys_internal ()
9195 -  Function *f;
9196 +  rl_command_func_t *f;
9198  #if defined (__MSDOS__)
9199    f = rl_function_of_keyseq ("\033[0A", _rl_keymap, (int *)NULL);
9200 @@ -781,6 +824,7 @@ bind_arrow_keys ()
9202    _rl_keymap = xkeymap;
9204 +#endif /* !__MINGW32__ */
9206  \f
9207  /* **************************************************************** */
9208 @@ -797,19 +841,23 @@ rl_digit_loop ()
9210    rl_save_prompt ();
9212 +  RL_SETSTATE(RL_STATE_NUMERICARG);
9213    sawminus = sawdigits = 0;
9214    while (1)
9215      {
9216        if (rl_numeric_arg > 1000000)
9217         {
9218           sawdigits = rl_explicit_arg = rl_numeric_arg = 0;
9219 -         ding ();
9220 +         rl_ding ();
9221           rl_restore_prompt ();
9222           rl_clear_message ();
9223 +         RL_UNSETSTATE(RL_STATE_NUMERICARG);
9224           return 1;
9225         }
9226        rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg);
9227 +      RL_SETSTATE(RL_STATE_MOREINPUT);
9228        key = c = rl_read_key ();
9229 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
9231        /* If we see a key bound to `universal-argument' after seeing digits,
9232          it ends the argument but is otherwise ignored. */
9233 @@ -823,9 +871,12 @@ rl_digit_loop ()
9234             }
9235           else
9236             {
9237 +             RL_SETSTATE(RL_STATE_MOREINPUT);
9238               key = rl_read_key ();
9239 +             RL_UNSETSTATE(RL_STATE_MOREINPUT);
9240               rl_restore_prompt ();
9241               rl_clear_message ();
9242 +             RL_UNSETSTATE(RL_STATE_NUMERICARG);
9243               return (_rl_dispatch (key, _rl_keymap));
9244             }
9245         }
9246 @@ -849,10 +900,12 @@ rl_digit_loop ()
9247             rl_explicit_arg = 1;
9248           rl_restore_prompt ();
9249           rl_clear_message ();
9250 +         RL_UNSETSTATE(RL_STATE_NUMERICARG);
9251           return (_rl_dispatch (key, _rl_keymap));
9252         }
9253      }
9255 +  RL_UNSETSTATE(RL_STATE_NUMERICARG);
9256    return 0;
9259 @@ -861,7 +914,7 @@ int
9260  rl_digit_argument (ignore, key)
9261       int ignore, key;
9263 -  rl_pending_input = key;
9264 +  rl_execute_next (key);
9265    return (rl_digit_loop ());
9268 @@ -869,7 +922,7 @@ rl_digit_argument (ignore, key)
9269  int
9270  rl_discard_argument ()
9272 -  ding ();
9273 +  rl_ding ();
9274    rl_clear_message ();
9275    _rl_init_argument ();
9276    return 0;
9277 @@ -906,7 +959,7 @@ rl_universal_argument (count, key)
9278     function. */
9279  int
9280  rl_insert_text (string)
9281 -     char *string;
9282 +     const char *string;
9284    register int i, l = strlen (string);
9286 @@ -999,7 +1052,7 @@ _rl_fix_point (fix_mark_too)
9288  void
9289  _rl_replace_text (text, start, end)
9290 -     char *text;
9291 +     const char *text;
9292       int start, end;
9294    rl_begin_undo_group ();
9295 @@ -1053,7 +1106,7 @@ rl_forward (count, key)
9296      {
9297        int end = rl_point + count;
9298  #if defined (VI_MODE)
9299 -      int lend = rl_end - (rl_editing_mode == vi_mode);
9300 +      int lend = rl_end > 0 ? rl_end - (rl_editing_mode == vi_mode) : rl_end;
9301  #else
9302        int lend = rl_end;
9303  #endif
9304 @@ -1061,7 +1114,7 @@ rl_forward (count, key)
9305        if (end > lend)
9306         {
9307           rl_point = lend;
9308 -         ding ();
9309 +         rl_ding ();
9310         }
9311        else
9312         rl_point = end;
9313 @@ -1085,7 +1138,7 @@ rl_backward (count, key)
9314        if (rl_point < count)
9315         {
9316           rl_point = 0;
9317 -         ding ();
9318 +         rl_ding ();
9319         }
9320        else
9321          rl_point -= count;
9322 @@ -1132,12 +1185,12 @@ rl_forward_word (count, key)
9323        /* If we are not in a word, move forward until we are in one.
9324          Then, move forward until we hit a non-alphabetic character. */
9325        c = the_line[rl_point];
9326 -      if (alphabetic (c) == 0)
9327 +      if (rl_alphabetic (c) == 0)
9328         {
9329           while (++rl_point < rl_end)
9330             {
9331               c = the_line[rl_point];
9332 -             if (alphabetic (c))
9333 +             if (rl_alphabetic (c))
9334                 break;
9335             }
9336         }
9337 @@ -1146,7 +1199,7 @@ rl_forward_word (count, key)
9338        while (++rl_point < rl_end)
9339         {
9340           c = the_line[rl_point];
9341 -         if (alphabetic (c) == 0)
9342 +         if (rl_alphabetic (c) == 0)
9343             break;
9344         }
9345        --count;
9346 @@ -1176,12 +1229,12 @@ rl_backward_word (count, key)
9347          just before point. */
9349        c = the_line[rl_point - 1];
9350 -      if (alphabetic (c) == 0)
9351 +      if (rl_alphabetic (c) == 0)
9352         {
9353           while (--rl_point)
9354             {
9355               c = the_line[rl_point - 1];
9356 -             if (alphabetic (c))
9357 +             if (rl_alphabetic (c))
9358                 break;
9359             }
9360         }
9361 @@ -1189,7 +1242,7 @@ rl_backward_word (count, key)
9362        while (rl_point)
9363         {
9364           c = the_line[rl_point - 1];
9365 -         if (alphabetic (c) == 0)
9366 +         if (rl_alphabetic (c) == 0)
9367             break;
9368           else
9369             --rl_point;
9370 @@ -1199,6 +1252,8 @@ rl_backward_word (count, key)
9371    return 0;
9374 +extern int _rl_current_display_line ();
9376  /* Clear the current line.  Numeric argument to C-l does this. */
9377  int
9378  rl_refresh_line (ignore1, ignore2)
9379 @@ -1245,7 +1300,9 @@ rl_arrow_keys (count, c)
9381    int ch;
9383 +  RL_SETSTATE(RL_STATE_MOREINPUT);
9384    ch = rl_read_key ();
9385 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
9387    switch (_rl_to_upper (ch))
9388      {
9389 @@ -1266,7 +1323,7 @@ rl_arrow_keys (count, c)
9390        break;
9392      default:
9393 -      ding ();
9394 +      rl_ding ();
9395      }
9396    return 0;
9398 @@ -1352,7 +1409,11 @@ rl_quoted_insert (count, key)
9399  #if defined (HANDLE_SIGNALS)
9400    _rl_disable_tty_signals ();
9401  #endif
9403 +  RL_SETSTATE(RL_STATE_MOREINPUT);
9404    c = rl_read_key ();
9405 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
9407  #if defined (HANDLE_SIGNALS)
9408    _rl_restore_tty_signals ();
9409  #endif
9410 @@ -1376,6 +1437,7 @@ rl_newline (count, key)
9411       int count, key;
9413    rl_done = 1;
9414 +  RL_SETSTATE(RL_STATE_DONE);
9416  #if defined (VI_MODE)
9417    if (rl_editing_mode == vi_mode)
9418 @@ -1386,7 +1448,7 @@ rl_newline (count, key)
9419  #endif /* VI_MODE */
9421    /* If we've been asked to erase empty lines, suppress the final update,
9422 -     since _rl_update_final calls crlf(). */
9423 +     since _rl_update_final calls rl_crlf(). */
9424    if (rl_erase_empty_line && rl_point == 0 && rl_end == 0)
9425      return 0;
9427 @@ -1419,7 +1481,7 @@ rl_rubout (count, key)
9429    if (!rl_point)
9430      {
9431 -      ding ();
9432 +      rl_ding ();
9433        return -1;
9434      }
9436 @@ -1455,7 +1517,7 @@ rl_delete (count, key)
9438    if (rl_point == rl_end)
9439      {
9440 -      ding ();
9441 +      rl_ding ();
9442        return -1;
9443      }
9445 @@ -1611,11 +1673,11 @@ rl_change_case (count, op)
9447         case CapCase:
9448           the_line[start] = (inword == 0) ? _rl_to_upper (c) : _rl_to_lower (c);
9449 -         inword = alphabetic (the_line[start]);
9450 +         inword = rl_alphabetic (the_line[start]);
9451           break;
9453         default:
9454 -         ding ();
9455 +         rl_ding ();
9456           return -1;
9457         }
9458      }
9459 @@ -1654,7 +1716,7 @@ rl_transpose_words (count, key)
9460    /* Do some check to make sure that there really are two words. */
9461    if ((w1_beg == w2_beg) || (w2_beg < w1_end))
9462      {
9463 -      ding ();
9464 +      rl_ding ();
9465        rl_point = orig_point;
9466        return -1;
9467      }
9468 @@ -1702,7 +1764,7 @@ rl_transpose_chars (count, key)
9470    if (!rl_point || rl_end < 2)
9471      {
9472 -      ding ();
9473 +      rl_ding ();
9474        return -1;
9475      }
9477 @@ -1746,7 +1808,7 @@ _rl_char_search_internal (count, dir, sc
9478      {
9479        if ((dir < 0 && pos <= 0) || (dir > 0 && pos >= rl_end))
9480         {
9481 -         ding ();
9482 +         rl_ding ();
9483           return -1;
9484         }
9486 @@ -1777,7 +1839,10 @@ _rl_char_search (count, fdir, bdir)
9488    int c;
9490 +  RL_SETSTATE(RL_STATE_MOREINPUT);
9491    c = rl_read_key ();
9492 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
9494    if (count < 0)
9495      return (_rl_char_search_internal (-count, bdir, c));
9496    else
9497 @@ -1810,17 +1875,17 @@ rl_backward_char_search (count, key)
9499  /* While we are editing the history, this is the saved
9500     version of the original line. */
9501 -HIST_ENTRY *saved_line_for_history = (HIST_ENTRY *)NULL;
9502 +HIST_ENTRY *_rl_saved_line_for_history = (HIST_ENTRY *)NULL;
9504  /* Set the history pointer back to the last entry in the history. */
9505  static void
9506  start_using_history ()
9508    using_history ();
9509 -  if (saved_line_for_history)
9510 -    _rl_free_history_entry (saved_line_for_history);
9511 +  if (_rl_saved_line_for_history)
9512 +    _rl_free_history_entry (_rl_saved_line_for_history);
9514 -  saved_line_for_history = (HIST_ENTRY *)NULL;
9515 +  _rl_saved_line_for_history = (HIST_ENTRY *)NULL;
9518  /* Free the contents (and containing structure) of a HIST_ENTRY. */
9519 @@ -1837,7 +1902,7 @@ _rl_free_history_entry (entry)
9521  /* Perhaps put back the current line if it has changed. */
9522  int
9523 -maybe_replace_line ()
9524 +rl_maybe_replace_line ()
9526    HIST_ENTRY *temp;
9528 @@ -1852,43 +1917,54 @@ maybe_replace_line ()
9529    return 0;
9532 -/* Put back the saved_line_for_history if there is one. */
9533 +/* Restore the _rl_saved_line_for_history if there is one. */
9534  int
9535 -maybe_unsave_line ()
9536 +rl_maybe_unsave_line ()
9538    int line_len;
9540 -  if (saved_line_for_history)
9541 +  if (_rl_saved_line_for_history)
9542      {
9543 -      line_len = strlen (saved_line_for_history->line);
9544 +      line_len = strlen (_rl_saved_line_for_history->line);
9546        if (line_len >= rl_line_buffer_len)
9547         rl_extend_line_buffer (line_len);
9549 -      strcpy (the_line, saved_line_for_history->line);
9550 -      rl_undo_list = (UNDO_LIST *)saved_line_for_history->data;
9551 -      _rl_free_history_entry (saved_line_for_history);
9552 -      saved_line_for_history = (HIST_ENTRY *)NULL;
9553 +      strcpy (the_line, _rl_saved_line_for_history->line);
9554 +      rl_undo_list = (UNDO_LIST *)_rl_saved_line_for_history->data;
9555 +      _rl_free_history_entry (_rl_saved_line_for_history);
9556 +      _rl_saved_line_for_history = (HIST_ENTRY *)NULL;
9557        rl_end = rl_point = strlen (the_line);
9558      }
9559    else
9560 -    ding ();
9561 +    rl_ding ();
9562    return 0;
9565 -/* Save the current line in saved_line_for_history. */
9566 +/* Save the current line in _rl_saved_line_for_history. */
9567  int
9568 -maybe_save_line ()
9569 +rl_maybe_save_line ()
9571 -  if (saved_line_for_history == 0)
9572 +  if (_rl_saved_line_for_history == 0)
9573      {
9574 -      saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
9575 -      saved_line_for_history->line = savestring (the_line);
9576 -      saved_line_for_history->data = (char *)rl_undo_list;
9577 +      _rl_saved_line_for_history = (HIST_ENTRY *)xmalloc (sizeof (HIST_ENTRY));
9578 +      _rl_saved_line_for_history->line = savestring (the_line);
9579 +      _rl_saved_line_for_history->data = (char *)rl_undo_list;
9580      }
9581    return 0;
9584 +int
9585 +_rl_free_saved_history_line ()
9587 +  if (_rl_saved_line_for_history)
9588 +    {
9589 +      _rl_free_history_entry (_rl_saved_line_for_history);
9590 +      _rl_saved_line_for_history = (HIST_ENTRY *)NULL;
9591 +    }
9592 +  return 0;
9593 +}      
9595  /* **************************************************************** */
9596  /*                                                                 */
9597  /*                     History Commands                            */
9598 @@ -1908,9 +1984,9 @@ int
9599  rl_end_of_history (count, key)
9600       int count, key;
9602 -  maybe_replace_line ();
9603 +  rl_maybe_replace_line ();
9604    using_history ();
9605 -  maybe_unsave_line ();
9606 +  rl_maybe_unsave_line ();
9607    return 0;
9610 @@ -1928,7 +2004,7 @@ rl_get_next_history (count, key)
9611    if (count == 0)
9612      return 0;
9614 -  maybe_replace_line ();
9615 +  rl_maybe_replace_line ();
9617    temp = (HIST_ENTRY *)NULL;
9618    while (count)
9619 @@ -1940,7 +2016,7 @@ rl_get_next_history (count, key)
9620      }
9622    if (temp == 0)
9623 -    maybe_unsave_line ();
9624 +    rl_maybe_unsave_line ();
9625    else
9626      {
9627        line_len = strlen (temp->line);
9628 @@ -1975,10 +2051,10 @@ rl_get_previous_history (count, key)
9629      return 0;
9631    /* If we don't have a line saved, then save this one. */
9632 -  maybe_save_line ();
9633 +  rl_maybe_save_line ();
9635    /* If the current line has changed, save the changes. */
9636 -  maybe_replace_line ();
9637 +  rl_maybe_replace_line ();
9639    temp = old_temp = (HIST_ENTRY *)NULL;
9640    while (count)
9641 @@ -1997,7 +2073,7 @@ rl_get_previous_history (count, key)
9642      temp = old_temp;
9644    if (temp == 0)
9645 -    ding ();
9646 +    rl_ding ();
9647    else
9648      {
9649        line_len = strlen (temp->line);
9650 @@ -2053,7 +2129,7 @@ rl_exchange_point_and_mark (count, key)
9652    if (rl_mark == -1)
9653      {
9654 -      ding ();
9655 +      rl_ding ();
9656        return -1;
9657      }
9658    else
9659 Index: readline/readline.h
9660 ===================================================================
9661 RCS file: /prjz/.cvsroot/gdb/readline/readline.h,v
9662 retrieving revision 1.1.1.1
9663 diff -u -3 -p -r1.1.1.1 readline.h
9664 --- readline/readline.h 2003/02/16 21:36:31     1.1.1.1
9665 +++ readline/readline.h 2003/02/17 12:47:10
9666 @@ -23,6 +23,14 @@
9667  #if !defined (_READLINE_H_)
9668  #define _READLINE_H_
9670 +#if __READLINE_EXPORT__
9671 +# define READLINE_API __declspec (dllexport)
9672 +#elif __READLINE_IMPORT__
9673 +# define READLINE_API __declspec (dllimport)
9674 +#else
9675 +# define READLINE_API
9676 +#endif
9678  #ifdef __cplusplus
9679  extern "C" {
9680  #endif
9681 @@ -56,15 +64,15 @@ typedef struct undo_list {
9682  } UNDO_LIST;
9684  /* The current undo list for RL_LINE_BUFFER. */
9685 -extern UNDO_LIST *rl_undo_list;
9686 +READLINE_API extern UNDO_LIST *rl_undo_list;
9688  /* The data structure for mapping textual names to code addresses. */
9689  typedef struct _funmap {
9690 -  char *name;
9691 -  Function *function;
9692 +  const char *name;
9693 +  rl_command_func_t *function;
9694  } FUNMAP;
9696 -extern FUNMAP **funmap;
9697 +READLINE_API extern FUNMAP **funmap;
9699  /* **************************************************************** */
9700  /*                                                                 */
9701 @@ -73,184 +81,184 @@ extern FUNMAP **funmap;
9702  /* **************************************************************** */
9704  /* Bindable commands for numeric arguments. */
9705 -extern int rl_digit_argument __P((int, int));
9706 -extern int rl_universal_argument __P((int, int));
9707 +READLINE_API extern int rl_digit_argument __P((int, int));
9708 +READLINE_API extern int rl_universal_argument __P((int, int));
9710  /* Bindable commands for moving the cursor. */
9711 -extern int rl_forward __P((int, int));
9712 -extern int rl_backward __P((int, int));
9713 -extern int rl_beg_of_line __P((int, int));
9714 -extern int rl_end_of_line __P((int, int));
9715 -extern int rl_forward_word __P((int, int));
9716 -extern int rl_backward_word __P((int, int));
9717 -extern int rl_refresh_line __P((int, int));
9718 -extern int rl_clear_screen __P((int, int));
9719 -extern int rl_arrow_keys __P((int, int));
9720 +READLINE_API extern int rl_forward __P((int, int));
9721 +READLINE_API extern int rl_backward __P((int, int));
9722 +READLINE_API extern int rl_beg_of_line __P((int, int));
9723 +READLINE_API extern int rl_end_of_line __P((int, int));
9724 +READLINE_API extern int rl_forward_word __P((int, int));
9725 +READLINE_API extern int rl_backward_word __P((int, int));
9726 +READLINE_API extern int rl_refresh_line __P((int, int));
9727 +READLINE_API extern int rl_clear_screen __P((int, int));
9728 +READLINE_API extern int rl_arrow_keys __P((int, int));
9730  /* Bindable commands for inserting and deleting text. */
9731 -extern int rl_insert __P((int, int));
9732 -extern int rl_quoted_insert __P((int, int));
9733 -extern int rl_tab_insert __P((int, int));
9734 -extern int rl_newline __P((int, int));
9735 -extern int rl_do_lowercase_version __P((int, int));
9736 -extern int rl_rubout __P((int, int));
9737 -extern int rl_delete __P((int, int));
9738 -extern int rl_rubout_or_delete __P((int, int));
9739 -extern int rl_delete_horizontal_space __P((int, int));
9740 -extern int rl_delete_or_show_completions __P((int, int));
9741 -extern int rl_insert_comment __P((int, int));
9742 +READLINE_API extern int rl_insert __P((int, int));
9743 +READLINE_API extern int rl_quoted_insert __P((int, int));
9744 +READLINE_API extern int rl_tab_insert __P((int, int));
9745 +READLINE_API extern int rl_newline __P((int, int));
9746 +READLINE_API extern int rl_do_lowercase_version __P((int, int));
9747 +READLINE_API extern int rl_rubout __P((int, int));
9748 +READLINE_API extern int rl_delete __P((int, int));
9749 +READLINE_API extern int rl_rubout_or_delete __P((int, int));
9750 +READLINE_API extern int rl_delete_horizontal_space __P((int, int));
9751 +READLINE_API extern int rl_delete_or_show_completions __P((int, int));
9752 +READLINE_API extern int rl_insert_comment __P((int, int));
9754  /* Bindable commands for changing case. */
9755 -extern int rl_upcase_word __P((int, int));
9756 -extern int rl_downcase_word __P((int, int));
9757 -extern int rl_capitalize_word __P((int, int));
9758 +READLINE_API extern int rl_upcase_word __P((int, int));
9759 +READLINE_API extern int rl_downcase_word __P((int, int));
9760 +READLINE_API extern int rl_capitalize_word __P((int, int));
9762  /* Bindable commands for transposing characters and words. */
9763 -extern int rl_transpose_words __P((int, int));
9764 -extern int rl_transpose_chars __P((int, int));
9765 +READLINE_API extern int rl_transpose_words __P((int, int));
9766 +READLINE_API extern int rl_transpose_chars __P((int, int));
9768  /* Bindable commands for searching within a line. */
9769 -extern int rl_char_search __P((int, int));
9770 -extern int rl_backward_char_search __P((int, int));
9771 +READLINE_API extern int rl_char_search __P((int, int));
9772 +READLINE_API extern int rl_backward_char_search __P((int, int));
9774  /* Bindable commands for readline's interface to the command history. */
9775 -extern int rl_beginning_of_history __P((int, int));
9776 -extern int rl_end_of_history __P((int, int));
9777 -extern int rl_get_next_history __P((int, int));
9778 -extern int rl_get_previous_history __P((int, int));
9779 +READLINE_API extern int rl_beginning_of_history __P((int, int));
9780 +READLINE_API extern int rl_end_of_history __P((int, int));
9781 +READLINE_API extern int rl_get_next_history __P((int, int));
9782 +READLINE_API extern int rl_get_previous_history __P((int, int));
9784  /* Bindable commands for managing the mark and region. */
9785 -extern int rl_set_mark __P((int, int));
9786 -extern int rl_exchange_point_and_mark __P((int, int));
9787 +READLINE_API extern int rl_set_mark __P((int, int));
9788 +READLINE_API extern int rl_exchange_point_and_mark __P((int, int));
9790  /* Bindable commands to set the editing mode (emacs or vi). */
9791 -extern int rl_vi_editing_mode __P((int, int));
9792 -extern int rl_emacs_editing_mode __P((int, int));
9793 +READLINE_API extern int rl_vi_editing_mode __P((int, int));
9794 +READLINE_API extern int rl_emacs_editing_mode __P((int, int));
9796  /* Bindable commands for managing key bindings. */
9797 -extern int rl_re_read_init_file __P((int, int));
9798 -extern int rl_dump_functions __P((int, int));
9799 -extern int rl_dump_macros __P((int, int));
9800 -extern int rl_dump_variables __P((int, int));
9801 +READLINE_API extern int rl_re_read_init_file __P((int, int));
9802 +READLINE_API extern int rl_dump_functions __P((int, int));
9803 +READLINE_API extern int rl_dump_macros __P((int, int));
9804 +READLINE_API extern int rl_dump_variables __P((int, int));
9806  /* Bindable commands for word completion. */
9807 -extern int rl_complete __P((int, int));
9808 -extern int rl_possible_completions __P((int, int));
9809 -extern int rl_insert_completions __P((int, int));
9810 -extern int rl_menu_complete __P((int, int));
9811 +READLINE_API extern int rl_complete __P((int, int));
9812 +READLINE_API extern int rl_possible_completions __P((int, int));
9813 +READLINE_API extern int rl_insert_completions __P((int, int));
9814 +READLINE_API extern int rl_menu_complete __P((int, int));
9816  /* Bindable commands for killing and yanking text, and managing the kill ring. */
9817 -extern int rl_kill_word __P((int, int));
9818 -extern int rl_backward_kill_word __P((int, int));
9819 -extern int rl_kill_line __P((int, int));
9820 -extern int rl_backward_kill_line __P((int, int));
9821 -extern int rl_kill_full_line __P((int, int));
9822 -extern int rl_unix_word_rubout __P((int, int));
9823 -extern int rl_unix_line_discard __P((int, int));
9824 -extern int rl_copy_region_to_kill __P((int, int));
9825 -extern int rl_kill_region __P((int, int));
9826 -extern int rl_copy_forward_word __P((int, int));
9827 -extern int rl_copy_backward_word __P((int, int));
9828 -extern int rl_yank __P((int, int));
9829 -extern int rl_yank_pop __P((int, int));
9830 -extern int rl_yank_nth_arg __P((int, int));
9831 -extern int rl_yank_last_arg __P((int, int));
9832 -/* Not available unless __CYGWIN32__ is defined. */
9833 -#ifdef __CYGWIN32__
9834 -extern int rl_paste_from_clipboard __P((int, int));
9835 +READLINE_API extern int rl_kill_word __P((int, int));
9836 +READLINE_API extern int rl_backward_kill_word __P((int, int));
9837 +READLINE_API extern int rl_kill_line __P((int, int));
9838 +READLINE_API extern int rl_backward_kill_line __P((int, int));
9839 +READLINE_API extern int rl_kill_full_line __P((int, int));
9840 +READLINE_API extern int rl_unix_word_rubout __P((int, int));
9841 +READLINE_API extern int rl_unix_line_discard __P((int, int));
9842 +READLINE_API extern int rl_copy_region_to_kill __P((int, int));
9843 +READLINE_API extern int rl_kill_region __P((int, int));
9844 +READLINE_API extern int rl_copy_forward_word __P((int, int));
9845 +READLINE_API extern int rl_copy_backward_word __P((int, int));
9846 +READLINE_API extern int rl_yank __P((int, int));
9847 +READLINE_API extern int rl_yank_pop __P((int, int));
9848 +READLINE_API extern int rl_yank_nth_arg __P((int, int));
9849 +READLINE_API extern int rl_yank_last_arg __P((int, int));
9850 +/* Not available unless __CYGWIN__ is defined. */
9851 +#if defined(__CYGWIN__) || defined (__MINGW32__)
9852 +READLINE_API extern int rl_paste_from_clipboard __P((int, int));
9853  #endif
9855  /* Bindable commands for incremental searching. */
9856 -extern int rl_reverse_search_history __P((int, int));
9857 -extern int rl_forward_search_history __P((int, int));
9858 +READLINE_API extern int rl_reverse_search_history __P((int, int));
9859 +READLINE_API extern int rl_forward_search_history __P((int, int));
9861  /* Bindable keyboard macro commands. */
9862 -extern int rl_start_kbd_macro __P((int, int));
9863 -extern int rl_end_kbd_macro __P((int, int));
9864 -extern int rl_call_last_kbd_macro __P((int, int));
9865 +READLINE_API extern int rl_start_kbd_macro __P((int, int));
9866 +READLINE_API extern int rl_end_kbd_macro __P((int, int));
9867 +READLINE_API extern int rl_call_last_kbd_macro __P((int, int));
9869  /* Bindable undo commands. */
9870 -extern int rl_revert_line __P((int, int));
9871 -extern int rl_undo_command __P((int, int));
9872 +READLINE_API extern int rl_revert_line __P((int, int));
9873 +READLINE_API extern int rl_undo_command __P((int, int));
9875  /* Bindable tilde expansion commands. */
9876 -extern int rl_tilde_expand __P((int, int));
9877 +READLINE_API extern int rl_tilde_expand __P((int, int));
9879  /* Bindable terminal control commands. */
9880 -extern int rl_restart_output __P((int, int));
9881 -extern int rl_stop_output __P((int, int));
9882 +READLINE_API extern int rl_restart_output __P((int, int));
9883 +READLINE_API extern int rl_stop_output __P((int, int));
9885  /* Miscellaneous bindable commands. */
9886 -extern int rl_abort __P((int, int));
9887 -extern int rl_tty_status __P((int, int));
9888 +READLINE_API extern int rl_abort __P((int, int));
9889 +READLINE_API extern int rl_tty_status __P((int, int));
9891  /* Bindable commands for incremental and non-incremental history searching. */
9892 -extern int rl_history_search_forward __P((int, int));
9893 -extern int rl_history_search_backward __P((int, int));
9894 -extern int rl_noninc_forward_search __P((int, int));
9895 -extern int rl_noninc_reverse_search __P((int, int));
9896 -extern int rl_noninc_forward_search_again __P((int, int));
9897 -extern int rl_noninc_reverse_search_again __P((int, int));
9898 +READLINE_API extern int rl_history_search_forward __P((int, int));
9899 +READLINE_API extern int rl_history_search_backward __P((int, int));
9900 +READLINE_API extern int rl_noninc_forward_search __P((int, int));
9901 +READLINE_API extern int rl_noninc_reverse_search __P((int, int));
9902 +READLINE_API extern int rl_noninc_forward_search_again __P((int, int));
9903 +READLINE_API extern int rl_noninc_reverse_search_again __P((int, int));
9905  /* Bindable command used when inserting a matching close character. */
9906 -extern int rl_insert_close __P((int, int));
9907 +READLINE_API extern int rl_insert_close __P((int, int));
9909  /* Not available unless READLINE_CALLBACKS is defined. */
9910 -extern void rl_callback_handler_install __P((char *, VFunction *));
9911 -extern void rl_callback_read_char __P((void));
9912 -extern void rl_callback_handler_remove __P((void));
9913 +READLINE_API extern void rl_callback_handler_install __P((const char *, rl_vcpfunc_t *));
9914 +READLINE_API extern void rl_callback_read_char __P((void));
9915 +READLINE_API extern void rl_callback_handler_remove __P((void));
9917  /* Things for vi mode. Not available unless readline is compiled -DVI_MODE. */
9918  /* VI-mode bindable commands. */
9919 -extern int rl_vi_redo __P((int, int));
9920 -extern int rl_vi_undo __P((int, int));
9921 -extern int rl_vi_yank_arg __P((int, int));
9922 -extern int rl_vi_fetch_history __P((int, int));
9923 -extern int rl_vi_search_again __P((int, int));
9924 -extern int rl_vi_search __P((int, int));
9925 -extern int rl_vi_complete __P((int, int));
9926 -extern int rl_vi_tilde_expand __P((int, int));
9927 -extern int rl_vi_prev_word __P((int, int));
9928 -extern int rl_vi_next_word __P((int, int));
9929 -extern int rl_vi_end_word __P((int, int));
9930 -extern int rl_vi_insert_beg __P((int, int));
9931 -extern int rl_vi_append_mode __P((int, int));
9932 -extern int rl_vi_append_eol __P((int, int));
9933 -extern int rl_vi_eof_maybe __P((int, int));
9934 -extern int rl_vi_insertion_mode __P((int, int));
9935 -extern int rl_vi_movement_mode __P((int, int));
9936 -extern int rl_vi_arg_digit __P((int, int));
9937 -extern int rl_vi_change_case __P((int, int));
9938 -extern int rl_vi_put __P((int, int));
9939 -extern int rl_vi_column __P((int, int));
9940 -extern int rl_vi_delete_to __P((int, int));
9941 -extern int rl_vi_change_to __P((int, int));
9942 -extern int rl_vi_yank_to __P((int, int));
9943 -extern int rl_vi_delete __P((int, int));
9944 -extern int rl_vi_back_to_indent __P((int, int));
9945 -extern int rl_vi_first_print __P((int, int));
9946 -extern int rl_vi_char_search __P((int, int));
9947 -extern int rl_vi_match __P((int, int));
9948 -extern int rl_vi_change_char __P((int, int));
9949 -extern int rl_vi_subst __P((int, int));
9950 -extern int rl_vi_overstrike __P((int, int));
9951 -extern int rl_vi_overstrike_delete __P((int, int));
9952 -extern int rl_vi_replace __P((int, int));
9953 -extern int rl_vi_set_mark __P((int, int));
9954 -extern int rl_vi_goto_mark __P((int, int));
9955 +READLINE_API extern int rl_vi_redo __P((int, int));
9956 +READLINE_API extern int rl_vi_undo __P((int, int));
9957 +READLINE_API extern int rl_vi_yank_arg __P((int, int));
9958 +READLINE_API extern int rl_vi_fetch_history __P((int, int));
9959 +READLINE_API extern int rl_vi_search_again __P((int, int));
9960 +READLINE_API extern int rl_vi_search __P((int, int));
9961 +READLINE_API extern int rl_vi_complete __P((int, int));
9962 +READLINE_API extern int rl_vi_tilde_expand __P((int, int));
9963 +READLINE_API extern int rl_vi_prev_word __P((int, int));
9964 +READLINE_API extern int rl_vi_next_word __P((int, int));
9965 +READLINE_API extern int rl_vi_end_word __P((int, int));
9966 +READLINE_API extern int rl_vi_insert_beg __P((int, int));
9967 +READLINE_API extern int rl_vi_append_mode __P((int, int));
9968 +READLINE_API extern int rl_vi_append_eol __P((int, int));
9969 +READLINE_API extern int rl_vi_eof_maybe __P((int, int));
9970 +READLINE_API extern int rl_vi_insertion_mode __P((int, int));
9971 +READLINE_API extern int rl_vi_movement_mode __P((int, int));
9972 +READLINE_API extern int rl_vi_arg_digit __P((int, int));
9973 +READLINE_API extern int rl_vi_change_case __P((int, int));
9974 +READLINE_API extern int rl_vi_put __P((int, int));
9975 +READLINE_API extern int rl_vi_column __P((int, int));
9976 +READLINE_API extern int rl_vi_delete_to __P((int, int));
9977 +READLINE_API extern int rl_vi_change_to __P((int, int));
9978 +READLINE_API extern int rl_vi_yank_to __P((int, int));
9979 +READLINE_API extern int rl_vi_delete __P((int, int));
9980 +READLINE_API extern int rl_vi_back_to_indent __P((int, int));
9981 +READLINE_API extern int rl_vi_first_print __P((int, int));
9982 +READLINE_API extern int rl_vi_char_search __P((int, int));
9983 +READLINE_API extern int rl_vi_match __P((int, int));
9984 +READLINE_API extern int rl_vi_change_char __P((int, int));
9985 +READLINE_API extern int rl_vi_subst __P((int, int));
9986 +READLINE_API extern int rl_vi_overstrike __P((int, int));
9987 +READLINE_API extern int rl_vi_overstrike_delete __P((int, int));
9988 +READLINE_API extern int rl_vi_replace __P((int, int));
9989 +READLINE_API extern int rl_vi_set_mark __P((int, int));
9990 +READLINE_API extern int rl_vi_goto_mark __P((int, int));
9992  /* VI-mode utility functions. */
9993 -extern int rl_vi_check __P((void));
9994 -extern int rl_vi_domove __P((int, int *));
9995 -extern int rl_vi_bracktype __P((int));
9996 +READLINE_API extern int rl_vi_check __P((void));
9997 +READLINE_API extern int rl_vi_domove __P((int, int *));
9998 +READLINE_API extern int rl_vi_bracktype __P((int));
10000  /* VI-mode pseudo-bindable commands, used as utility functions. */
10001 -extern int rl_vi_fWord __P((int, int));
10002 -extern int rl_vi_bWord __P((int, int));
10003 -extern int rl_vi_eWord __P((int, int));
10004 -extern int rl_vi_fword __P((int, int));
10005 -extern int rl_vi_bword __P((int, int));
10006 -extern int rl_vi_eword __P((int, int));
10007 +READLINE_API extern int rl_vi_fWord __P((int, int));
10008 +READLINE_API extern int rl_vi_bWord __P((int, int));
10009 +READLINE_API extern int rl_vi_eWord __P((int, int));
10010 +READLINE_API extern int rl_vi_fword __P((int, int));
10011 +READLINE_API extern int rl_vi_bword __P((int, int));
10012 +READLINE_API extern int rl_vi_eword __P((int, int));
10014  /* **************************************************************** */
10015  /*                                                                 */
10016 @@ -260,142 +268,172 @@ extern int rl_vi_eword __P((int, int));
10018  /* Readline functions. */
10019  /* Read a line of input.  Prompt with PROMPT.  A NULL PROMPT means none. */
10020 -extern char *readline __P((char *));
10021 +READLINE_API extern char *readline __P((const char *));
10023 -extern int rl_initialize __P((void));
10024 +READLINE_API extern int rl_set_prompt __P((const char *));
10025 +READLINE_API extern int rl_expand_prompt __P((char *));
10027 -extern int rl_discard_argument __P((void));
10028 +READLINE_API extern int rl_initialize __P((void));
10030 +/* Undocumented; unused by readline */
10031 +READLINE_API extern int rl_discard_argument __P((void));
10033  /* Utility functions to bind keys to readline commands. */
10034 -extern int rl_add_defun __P((char *, Function *, int));
10035 -extern int rl_bind_key __P((int, Function *));
10036 -extern int rl_bind_key_in_map __P((int, Function *, Keymap));
10037 -extern int rl_unbind_key __P((int));
10038 -extern int rl_unbind_key_in_map __P((int, Keymap));
10039 -extern int rl_unbind_function_in_map __P((Function *, Keymap));
10040 -extern int rl_unbind_command_in_map __P((char *, Keymap));
10041 -extern int rl_set_key __P((char *, Function *, Keymap));
10042 -extern int rl_generic_bind __P((int, char *, char *, Keymap));
10043 -extern int rl_variable_bind __P((char *, char *));
10044 +READLINE_API extern int rl_add_defun __P((const char *, rl_command_func_t *, int));
10045 +READLINE_API extern int rl_bind_key __P((int, rl_command_func_t *));
10046 +READLINE_API extern int rl_bind_key_in_map __P((int, rl_command_func_t *, Keymap));
10047 +READLINE_API extern int rl_unbind_key __P((int));
10048 +READLINE_API extern int rl_unbind_key_in_map __P((int, Keymap));
10049 +READLINE_API extern int rl_unbind_function_in_map __P((rl_command_func_t *, Keymap));
10050 +READLINE_API extern int rl_unbind_command_in_map __P((const char *, Keymap));
10051 +READLINE_API extern int rl_set_key __P((const char *, rl_command_func_t *, Keymap));
10052 +READLINE_API extern int rl_generic_bind __P((int, const char *, char *, Keymap));
10053 +READLINE_API extern int rl_variable_bind __P((const char *, const char *));
10055  /* Backwards compatibility, use rl_generic_bind instead. */
10056 -extern int rl_macro_bind __P((char *, char *, Keymap));
10057 +READLINE_API extern int rl_macro_bind __P((const char *, const char *, Keymap));
10059  /* Undocumented in the texinfo manual; not really useful to programs. */
10060 -extern int rl_translate_keyseq __P((char *, char *, int *));
10061 -extern char *rl_untranslate_keyseq __P((int));
10062 +READLINE_API extern int rl_translate_keyseq __P((const char *, char *, int *));
10063 +READLINE_API extern char *rl_untranslate_keyseq __P((int));
10065 -extern Function *rl_named_function __P((char *));
10066 -extern Function *rl_function_of_keyseq __P((char *, Keymap, int *));
10067 +READLINE_API extern rl_command_func_t *rl_named_function __P((const char *));
10068 +READLINE_API extern rl_command_func_t *rl_function_of_keyseq __P((const char *, Keymap, int *));
10070 -extern void rl_list_funmap_names __P((void));
10071 -extern char **rl_invoking_keyseqs_in_map __P((Function *, Keymap));
10072 -extern char **rl_invoking_keyseqs __P((Function *));
10073 +READLINE_API extern void rl_list_funmap_names __P((void));
10074 +READLINE_API extern char **rl_invoking_keyseqs_in_map __P((rl_command_func_t *, Keymap));
10075 +READLINE_API extern char **rl_invoking_keyseqs __P((rl_command_func_t *));
10076   
10077 -extern void rl_function_dumper __P((int));
10078 -extern void rl_macro_dumper __P((int));
10079 -extern void rl_variable_dumper __P((int));
10080 +READLINE_API extern void rl_function_dumper __P((int));
10081 +READLINE_API extern void rl_macro_dumper __P((int));
10082 +READLINE_API extern void rl_variable_dumper __P((int));
10084 -extern int rl_read_init_file __P((char *));
10085 -extern int rl_parse_and_bind __P((char *));
10086 +READLINE_API extern int rl_read_init_file __P((const char *));
10087 +READLINE_API extern int rl_parse_and_bind __P((char *));
10089  /* Functions for manipulating keymaps. */
10090 -extern Keymap rl_make_bare_keymap __P((void));
10091 -extern Keymap rl_copy_keymap __P((Keymap));
10092 -extern Keymap rl_make_keymap __P((void));
10093 -extern void rl_discard_keymap __P((Keymap));
10095 -extern Keymap rl_get_keymap_by_name __P((char *));
10096 -extern char *rl_get_keymap_name __P((Keymap));
10097 -extern void rl_set_keymap __P((Keymap));
10098 -extern Keymap rl_get_keymap __P((void));
10099 -extern void rl_set_keymap_from_edit_mode __P((void));
10100 -extern char *rl_get_keymap_name_from_edit_mode __P((void));
10101 +READLINE_API extern Keymap rl_make_bare_keymap __P((void));
10102 +READLINE_API extern Keymap rl_copy_keymap __P((Keymap));
10103 +READLINE_API extern Keymap rl_make_keymap __P((void));
10104 +READLINE_API extern void rl_discard_keymap __P((Keymap));
10106 +READLINE_API extern Keymap rl_get_keymap_by_name __P((const char *));
10107 +READLINE_API extern char *rl_get_keymap_name __P((Keymap));
10108 +READLINE_API extern void rl_set_keymap __P((Keymap));
10109 +READLINE_API extern Keymap rl_get_keymap __P((void));
10110 +/* Undocumented; used internally only. */
10111 +READLINE_API extern void rl_set_keymap_from_edit_mode __P((void));
10112 +READLINE_API extern char *rl_get_keymap_name_from_edit_mode __P((void));
10114  /* Functions for manipulating the funmap, which maps command names to functions. */
10115 -extern int rl_add_funmap_entry __P((char *, Function *));
10116 -extern void rl_initialize_funmap __P((void));
10117 -extern char **rl_funmap_names __P((void));
10118 +READLINE_API extern int rl_add_funmap_entry __P((const char *, rl_command_func_t *));
10119 +READLINE_API extern const char **rl_funmap_names __P((void));
10120 +/* Undocumented, only used internally -- there is only one funmap, and this
10121 +   function may be called only once. */
10122 +READLINE_API extern void rl_initialize_funmap __P((void));
10124  /* Utility functions for managing keyboard macros. */
10125 -extern void rl_push_macro_input __P((char *));
10126 +READLINE_API extern void rl_push_macro_input __P((char *));
10128  /* Functions for undoing, from undo.c */
10129 -extern void rl_add_undo __P((enum undo_code, int, int, char *));
10130 -extern void free_undo_list __P((void));
10131 -extern int rl_do_undo __P((void));
10132 -extern int rl_begin_undo_group __P((void));
10133 -extern int rl_end_undo_group __P((void));
10134 -extern int rl_modifying __P((int, int));
10135 +READLINE_API extern void rl_add_undo __P((enum undo_code, int, int, char *));
10136 +READLINE_API extern void rl_free_undo_list __P((void));
10137 +READLINE_API extern int rl_do_undo __P((void));
10138 +READLINE_API extern int rl_begin_undo_group __P((void));
10139 +READLINE_API extern int rl_end_undo_group __P((void));
10140 +READLINE_API extern int rl_modifying __P((int, int));
10142  /* Functions for redisplay. */
10143 -extern void rl_redisplay __P((void));
10144 -extern int rl_on_new_line __P((void));
10145 -extern int rl_on_new_line_with_prompt __P((void));
10146 -extern int rl_forced_update_display __P((void));
10147 -extern int rl_clear_message __P((void));
10148 -extern int rl_reset_line_state __P((void));
10149 +READLINE_API extern void rl_redisplay __P((void));
10150 +READLINE_API extern int rl_on_new_line __P((void));
10151 +READLINE_API extern int rl_on_new_line_with_prompt __P((void));
10152 +READLINE_API extern int rl_forced_update_display __P((void));
10153 +READLINE_API extern int rl_clear_message __P((void));
10154 +READLINE_API extern int rl_reset_line_state __P((void));
10155 +READLINE_API extern int rl_crlf __P((void));
10157  #if (defined (__STDC__) || defined (__cplusplus)) && defined (USE_VARARGS) && defined (PREFER_STDARG)
10158 -extern int rl_message (const char *, ...);
10159 +READLINE_API extern int rl_message (const char *, ...);
10160  #else
10161 -extern int rl_message ();
10162 +READLINE_API extern int rl_message ();
10163  #endif
10165 +READLINE_API extern int rl_show_char __P((int));
10167  /* Undocumented in texinfo manual. */
10168 -extern int rl_show_char __P((int));
10169 -extern int rl_character_len __P((int, int));
10170 -extern int crlf __P((void));
10171 +READLINE_API extern int rl_character_len __P((int, int));
10173  /* Save and restore internal prompt redisplay information. */
10174 -extern void rl_save_prompt __P((void));
10175 -extern void rl_restore_prompt __P((void));
10176 +READLINE_API extern void rl_save_prompt __P((void));
10177 +READLINE_API extern void rl_restore_prompt __P((void));
10179  /* Modifying text. */
10180 -extern int rl_insert_text __P((char *));
10181 -extern int rl_delete_text __P((int, int));
10182 -extern int rl_kill_text __P((int, int));
10183 -extern char *rl_copy_text __P((int, int));
10184 +READLINE_API extern int rl_insert_text __P((const char *));
10185 +READLINE_API extern int rl_delete_text __P((int, int));
10186 +READLINE_API extern int rl_kill_text __P((int, int));
10187 +READLINE_API extern char *rl_copy_text __P((int, int));
10189  /* Terminal and tty mode management. */
10190 -extern void rl_prep_terminal __P((int));
10191 -extern void rl_deprep_terminal __P((void));
10192 -extern void rltty_set_default_bindings __P((Keymap));
10193 +READLINE_API extern void rl_prep_terminal __P((int));
10194 +READLINE_API extern void rl_deprep_terminal __P((void));
10195 +READLINE_API extern void rl_tty_set_default_bindings __P((Keymap));
10197 +READLINE_API extern int rl_reset_terminal __P((const char *));
10198 +READLINE_API extern void rl_resize_terminal __P((void));
10199 +READLINE_API extern void rl_set_screen_size __P((int, int));
10200 +READLINE_API extern void rl_get_screen_size __P((int *, int *));
10202 -extern int rl_reset_terminal __P((char *));
10203 -extern void rl_resize_terminal __P((void));
10204 +/* Functions for character input. */
10205 +READLINE_API extern int rl_stuff_char __P((int));
10206 +READLINE_API extern int rl_execute_next __P((int));
10207 +READLINE_API extern int rl_clear_pending_input __P((void));
10208 +READLINE_API extern int rl_read_key __P((void));
10209 +READLINE_API extern int rl_getc __P((FILE *));
10210 +READLINE_API extern int rl_set_keyboard_input_timeout __P((int));
10212  /* `Public' utility functions . */
10213 -extern void rl_extend_line_buffer __P((int));
10214 -extern int ding __P((void));
10215 +READLINE_API extern void rl_extend_line_buffer __P((int));
10216 +READLINE_API extern int rl_ding __P((void));
10217 +READLINE_API extern int rl_alphabetic __P((int));
10219 -/* Functions for character input. */
10220 -extern int rl_stuff_char __P((int));
10221 -extern int rl_execute_next __P((int));
10222 -extern int rl_read_key __P((void));
10223 -extern int rl_getc __P((FILE *));
10225  /* Readline signal handling, from signals.c */
10226 -extern int rl_set_signals __P((void));
10227 -extern int rl_clear_signals __P((void));
10228 -extern void rl_cleanup_after_signal __P((void));
10229 -extern void rl_reset_after_signal __P((void));
10230 -extern void rl_free_line_state __P((void));
10231 +READLINE_API extern int rl_set_signals __P((void));
10232 +READLINE_API extern int rl_clear_signals __P((void));
10233 +READLINE_API extern void rl_cleanup_after_signal __P((void));
10234 +READLINE_API extern void rl_reset_after_signal __P((void));
10235 +READLINE_API extern void rl_free_line_state __P((void));
10236   
10237  /* Undocumented. */
10238 -extern int rl_expand_prompt __P((char *));
10239 +READLINE_API extern int rl_set_paren_blink_timeout __P((int));
10241 -extern int maybe_save_line __P((void));
10242 -extern int maybe_unsave_line __P((void));
10243 -extern int maybe_replace_line __P((void));
10244 +/* Undocumented. */
10245 +READLINE_API extern int rl_maybe_save_line __P((void));
10246 +READLINE_API extern int rl_maybe_unsave_line __P((void));
10247 +READLINE_API extern int rl_maybe_replace_line __P((void));
10249  /* Completion functions. */
10250 -extern int rl_complete_internal __P((int));
10251 -extern void rl_display_match_list __P((char **, int, int));
10252 +READLINE_API extern int rl_complete_internal __P((int));
10253 +READLINE_API extern void rl_display_match_list __P((char **, int, int));
10255 -extern char **completion_matches __P((char *, CPFunction *));
10256 -extern char *username_completion_function __P((char *, int));
10257 -extern char *filename_completion_function __P((char *, int));
10258 +READLINE_API extern char **rl_completion_matches __P((const char *, rl_compentry_func_t *));
10259 +READLINE_API extern char *rl_username_completion_function __P((const char *, int));
10260 +READLINE_API extern char *rl_filename_completion_function __P((const char *, int));
10262 +#if 1
10263 +/* Backwards compatibility (compat.c).  These will go away sometime. */
10264 +READLINE_API extern void free_undo_list __P((void));
10265 +READLINE_API extern int maybe_save_line __P((void));
10266 +READLINE_API extern int maybe_unsave_line __P((void));
10267 +READLINE_API extern int maybe_replace_line __P((void));
10269 +READLINE_API extern int ding __P((void));
10270 +READLINE_API extern int alphabetic __P((int));
10271 +READLINE_API extern int crlf __P((void));
10273 +READLINE_API extern char **completion_matches __P((const char *, rl_compentry_func_t *));
10274 +READLINE_API extern char *username_completion_function __P((const char *, int));
10275 +READLINE_API extern char *filename_completion_function __P((const char *, int));
10276 +#endif
10278  /* **************************************************************** */
10279  /*                                                                 */
10280 @@ -404,100 +442,126 @@ extern char *filename_completion_functio
10281  /* **************************************************************** */
10283  /* The version of this incarnation of the readline library. */
10284 -extern char *rl_library_version;
10285 +READLINE_API extern const char *rl_library_version;
10287  /* True if this is real GNU readline. */
10288 -extern int rl_gnu_readline_p;
10289 +READLINE_API extern int rl_gnu_readline_p;
10291 +/* Flags word encapsulating the current readline state. */
10292 +READLINE_API extern int rl_readline_state;
10294 +/* Says which editing mode readline is currently using.  1 means emacs mode;
10295 +   0 means vi mode. */
10296 +READLINE_API extern int rl_editing_mode;
10298  /* The name of the calling program.  You should initialize this to
10299     whatever was in argv[0].  It is used when parsing conditionals. */
10300 -extern char *rl_readline_name;
10301 +READLINE_API extern const char *rl_readline_name;
10303  /* The prompt readline uses.  This is set from the argument to
10304     readline (), and should not be assigned to directly. */
10305 -extern char *rl_prompt;
10306 +READLINE_API extern char *rl_prompt;
10308  /* The line buffer that is in use. */
10309 -extern char *rl_line_buffer;
10310 +READLINE_API extern char *rl_line_buffer;
10312  /* The location of point, and end. */
10313 -extern int rl_point, rl_end;
10314 +READLINE_API extern int rl_point;
10315 +READLINE_API extern int rl_end;
10317  /* The mark, or saved cursor position. */
10318 -extern int rl_mark;
10319 +READLINE_API extern int rl_mark;
10321  /* Flag to indicate that readline has finished with the current input
10322     line and should return it. */
10323 -extern int rl_done;
10324 +READLINE_API extern int rl_done;
10326  /* If set to a character value, that will be the next keystroke read. */
10327 -extern int rl_pending_input;
10328 +READLINE_API extern int rl_pending_input;
10330  /* Non-zero if we called this function from _rl_dispatch().  It's present
10331     so functions can find out whether they were called from a key binding
10332     or directly from an application. */
10333 -extern int rl_dispatching;
10334 +READLINE_API extern int rl_dispatching;
10336 +/* Non-zero if the user typed a numeric argument before executing the
10337 +   current function. */
10338 +READLINE_API extern int rl_explicit_arg;
10340 +/* The current value of the numeric argument specified by the user. */
10341 +READLINE_API extern int rl_numeric_arg;
10343 +/* The address of the last command function Readline executed. */
10344 +READLINE_API extern rl_command_func_t *rl_last_func;
10346  /* The name of the terminal to use. */
10347 -extern char *rl_terminal_name;
10348 +READLINE_API extern const char *rl_terminal_name;
10350  /* The input and output streams. */
10351 -extern FILE *rl_instream, *rl_outstream;
10352 +READLINE_API extern FILE *rl_instream;
10353 +READLINE_API extern FILE *rl_outstream;
10355  /* If non-zero, then this is the address of a function to call just
10356     before readline_internal () prints the first prompt. */
10357 -extern Function *rl_startup_hook;
10358 +READLINE_API extern rl_hook_func_t *rl_startup_hook;
10360  /* If non-zero, this is the address of a function to call just before
10361     readline_internal_setup () returns and readline_internal starts
10362     reading input characters. */
10363 -extern Function *rl_pre_input_hook;
10364 +READLINE_API extern rl_hook_func_t *rl_pre_input_hook;
10365        
10366  /* The address of a function to call periodically while Readline is
10367     awaiting character input, or NULL, for no event handling. */
10368 -extern Function *rl_event_hook;
10369 +READLINE_API extern rl_hook_func_t *rl_event_hook;
10371 +/* The address of the function to call to fetch a character from the current
10372 +   Readline input stream */
10373 +READLINE_API extern rl_getc_func_t *rl_getc_function;
10375 -extern Function *rl_getc_function;
10376 -extern VFunction *rl_redisplay_function;
10377 -extern VFunction *rl_prep_term_function;
10378 -extern VFunction *rl_deprep_term_function;
10379 +READLINE_API extern rl_voidfunc_t *rl_redisplay_function;
10381 +READLINE_API extern rl_vintfunc_t *rl_prep_term_function;
10382 +READLINE_API extern rl_voidfunc_t *rl_deprep_term_function;
10384  /* Dispatch variables. */
10385 -extern Keymap rl_executing_keymap;
10386 -extern Keymap rl_binding_keymap;
10387 +READLINE_API extern Keymap rl_executing_keymap;
10388 +READLINE_API extern Keymap rl_binding_keymap;
10390  /* Display variables. */
10391  /* If non-zero, readline will erase the entire line, including any prompt,
10392     if the only thing typed on an otherwise-blank line is something bound to
10393     rl_newline. */
10394 -extern int rl_erase_empty_line;
10395 +READLINE_API extern int rl_erase_empty_line;
10397  /* If non-zero, the application has already printed the prompt (rl_prompt)
10398     before calling readline, so readline should not output it the first time
10399     redisplay is done. */
10400 -extern int rl_already_prompted;
10401 +READLINE_API extern int rl_already_prompted;
10403  /* A non-zero value means to read only this many characters rather than
10404     up to a character bound to accept-line. */
10405 -extern int rl_num_chars_to_read;
10406 +READLINE_API extern int rl_num_chars_to_read;
10408 +/* The text of a currently-executing keyboard macro. */
10409 +READLINE_API extern char *rl_executing_macro;
10411  /* Variables to control readline signal handling. */
10412  /* If non-zero, readline will install its own signal handlers for
10413     SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU. */
10414 -extern int rl_catch_signals;
10415 +READLINE_API extern int rl_catch_signals;
10417  /* If non-zero, readline will install a signal handler for SIGWINCH
10418     that also attempts to call any calling application's SIGWINCH signal
10419     handler.  Note that the terminal is not cleaned up before the
10420     application's signal handler is called; use rl_cleanup_after_signal()
10421     to do that. */
10422 -extern int rl_catch_sigwinch;
10423 +READLINE_API extern int rl_catch_sigwinch;
10425  /* Completion variables. */
10426  /* Pointer to the generator function for completion_matches ().
10427     NULL means to use filename_entry_function (), the default filename
10428     completer. */
10429 -extern Function *rl_completion_entry_function;
10430 +READLINE_API extern rl_compentry_func_t *rl_completion_entry_function;
10432  /* If rl_ignore_some_completions_function is non-NULL it is the address
10433     of a function to call after all of the possible matches have been
10434 @@ -505,7 +569,7 @@ extern Function *rl_completion_entry_fun
10435     The function is called with one argument; a NULL terminated array
10436     of (char *).  If your function removes any of the elements, they
10437     must be free()'ed. */
10438 -extern Function *rl_ignore_some_completions_function;
10439 +READLINE_API extern rl_compignore_func_t *rl_ignore_some_completions_function;
10441  /* Pointer to alternative function to create matches.
10442     Function is called with TEXT, START, and END.
10443 @@ -514,39 +578,50 @@ extern Function *rl_ignore_some_completi
10444     If this function exists and returns NULL then call the value of
10445     rl_completion_entry_function to try to match, otherwise use the
10446     array of strings returned. */
10447 -extern CPPFunction *rl_attempted_completion_function;
10448 +READLINE_API extern rl_completion_func_t *rl_attempted_completion_function;
10450  /* The basic list of characters that signal a break between words for the
10451     completer routine.  The initial contents of this variable is what
10452     breaks words in the shell, i.e. "n\"\\'`@$>". */
10453 -extern char *rl_basic_word_break_characters;
10454 +READLINE_API extern const char *rl_basic_word_break_characters;
10456  /* The list of characters that signal a break between words for
10457     rl_complete_internal.  The default list is the contents of
10458     rl_basic_word_break_characters.  */
10459 -extern char *rl_completer_word_break_characters;
10460 +READLINE_API extern const char *rl_completer_word_break_characters;
10462  /* List of characters which can be used to quote a substring of the line.
10463     Completion occurs on the entire substring, and within the substring   
10464     rl_completer_word_break_characters are treated as any other character,
10465     unless they also appear within this list. */
10466 -extern char *rl_completer_quote_characters;
10467 +READLINE_API extern const char *rl_completer_quote_characters;
10469  /* List of quote characters which cause a word break. */
10470 -extern char *rl_basic_quote_characters;
10471 +READLINE_API extern const char *rl_basic_quote_characters;
10473  /* List of characters that need to be quoted in filenames by the completer. */
10474 -extern char *rl_filename_quote_characters;
10475 +READLINE_API extern const char *rl_filename_quote_characters;
10477  /* List of characters that are word break characters, but should be left
10478     in TEXT when it is passed to the completion function.  The shell uses
10479     this to help determine what kind of completing to do. */
10480 -extern char *rl_special_prefixes;
10481 +READLINE_API extern const char *rl_special_prefixes;
10483  /* If non-zero, then this is the address of a function to call when
10484     completing on a directory name.  The function is called with
10485 -   the address of a string (the current directory name) as an arg. */
10486 -extern Function *rl_directory_completion_hook;
10487 +   the address of a string (the current directory name) as an arg.  It
10488 +   changes what is displayed when the possible completions are printed
10489 +   or inserted. */
10490 +READLINE_API extern rl_icppfunc_t *rl_directory_completion_hook;
10492 +/* If non-zero, this is the address of a function to call when completing
10493 +   a directory name.  This function takes the address of the directory name
10494 +   to be modified as an argument.  Unlike rl_directory_completion_hook, it
10495 +   only modifies the directory name used in opendir(2), not what is displayed
10496 +   when the possible completions are printed or inserted.  It is called
10497 +   before rl_directory_completion_hook.  I'm not happy with how this works
10498 +   yet, so it's undocumented. */
10499 +READLINE_API extern rl_icppfunc_t *rl_directory_rewrite_hook;
10501  /* Backwards compatibility with previous versions of readline. */
10502  #define rl_symbolic_link_hook rl_directory_completion_hook
10503 @@ -558,60 +633,60 @@ extern Function *rl_directory_completion
10504     where MATCHES is the array of strings that matched, NUM_MATCHES is the
10505     number of strings in that array, and MAX_LENGTH is the length of the
10506     longest string in that array. */
10507 -extern VFunction *rl_completion_display_matches_hook;
10508 +READLINE_API extern rl_compdisp_func_t *rl_completion_display_matches_hook;
10510  /* Non-zero means that the results of the matches are to be treated
10511     as filenames.  This is ALWAYS zero on entry, and can only be changed
10512     within a completion entry finder function. */
10513 -extern int rl_filename_completion_desired;
10514 +READLINE_API extern int rl_filename_completion_desired;
10516  /* Non-zero means that the results of the matches are to be quoted using
10517     double quotes (or an application-specific quoting mechanism) if the
10518     filename contains any characters in rl_word_break_chars.  This is
10519     ALWAYS non-zero on entry, and can only be changed within a completion
10520     entry finder function. */
10521 -extern int rl_filename_quoting_desired;
10522 +READLINE_API extern int rl_filename_quoting_desired;
10524  /* Set to a function to quote a filename in an application-specific fashion.
10525     Called with the text to quote, the type of match found (single or multiple)
10526     and a pointer to the quoting character to be used, which the function can
10527     reset if desired. */
10528 -extern CPFunction *rl_filename_quoting_function;
10529 +READLINE_API extern rl_quote_func_t *rl_filename_quoting_function;
10531  /* Function to call to remove quoting characters from a filename.  Called
10532     before completion is attempted, so the embedded quotes do not interfere
10533     with matching names in the file system. */
10534 -extern CPFunction *rl_filename_dequoting_function;
10535 +READLINE_API extern rl_dequote_func_t *rl_filename_dequoting_function;
10537  /* Function to call to decide whether or not a word break character is
10538     quoted.  If a character is quoted, it does not break words for the
10539     completer. */
10540 -extern Function *rl_char_is_quoted_p;
10541 +READLINE_API extern rl_linebuf_func_t *rl_char_is_quoted_p;
10543  /* Non-zero means to suppress normal filename completion after the
10544     user-specified completion function has been called. */
10545 -extern int rl_attempted_completion_over;
10546 +READLINE_API extern int rl_attempted_completion_over;
10548  /* Set to a character describing the type of completion being attempted by
10549     rl_complete_internal; available for use by application completion
10550     functions. */
10551 -extern int rl_completion_type;
10552 +READLINE_API extern int rl_completion_type;
10554  /* Character appended to completed words when at the end of the line.  The
10555     default is a space.  Nothing is added if this is '\0'. */
10556 -extern int rl_completion_append_character;
10557 +READLINE_API extern int rl_completion_append_character;
10559  /* Up to this many items will be displayed in response to a
10560     possible-completions call.  After that, we ask the user if she
10561     is sure she wants to see them all.  The default value is 100. */
10562 -extern int rl_completion_query_items;
10563 +READLINE_API extern int rl_completion_query_items;
10565  /* If non-zero, then disallow duplicates in the matches. */
10566 -extern int rl_ignore_completion_duplicates;
10567 +READLINE_API extern int rl_ignore_completion_duplicates;
10569  /* If this is non-zero, completion is (temporarily) inhibited, and the
10570     completion character will be inserted as any other. */
10571 -extern int rl_inhibit_completion;
10572 +READLINE_API extern int rl_inhibit_completion;
10573     
10574  /* Definitions available for use by readline clients. */
10575  #define RL_PROMPT_START_IGNORE '\001'
10576 @@ -623,11 +698,33 @@ extern int rl_inhibit_completion;
10577  #define SINGLE_MATCH    1
10578  #define MULT_MATCH      2
10580 -#if 0
10581 -#if !defined (savestring)
10582 -extern char *savestring __P((char *)); /* XXX backwards compatibility */
10583 -#endif
10584 -#endif
10585 +/* Possible state values for rl_readline_state */
10586 +#define RL_STATE_NONE          0x00000         /* no state; before first call */
10588 +#define RL_STATE_INITIALIZING  0x00001         /* initializing */
10589 +#define RL_STATE_INITIALIZED   0x00002         /* initialization done */
10590 +#define RL_STATE_TERMPREPPED   0x00004         /* terminal is prepped */
10591 +#define RL_STATE_READCMD       0x00008         /* reading a command key */
10592 +#define RL_STATE_METANEXT      0x00010         /* reading input after ESC */
10593 +#define RL_STATE_DISPATCHING   0x00020         /* dispatching to a command */
10594 +#define RL_STATE_MOREINPUT     0x00040         /* reading more input in a command function */
10595 +#define RL_STATE_ISEARCH       0x00080         /* doing incremental search */
10596 +#define RL_STATE_NSEARCH       0x00100         /* doing non-inc search */
10597 +#define RL_STATE_SEARCH                0x00200         /* doing a history search */
10598 +#define RL_STATE_NUMERICARG    0x00400         /* reading numeric argument */
10599 +#define RL_STATE_MACROINPUT    0x00800         /* getting input from a macro */
10600 +#define RL_STATE_MACRODEF      0x01000         /* defining keyboard macro */
10601 +#define RL_STATE_OVERWRITE     0x02000         /* overwrite mode */
10602 +#define RL_STATE_COMPLETING    0x04000         /* doing completion */
10603 +#define RL_STATE_SIGHANDLER    0x08000         /* in readline sighandler */
10604 +#define RL_STATE_UNDOING       0x10000         /* doing an undo */
10605 +#define RL_STATE_INPUTPENDING  0x20000         /* rl_execute_next called */
10607 +#define RL_STATE_DONE          0x80000         /* done; accepted line */
10609 +#define RL_SETSTATE(x)         (rl_readline_state |= (x))
10610 +#define RL_UNSETSTATE(x)       (rl_readline_state &= ~(x))
10611 +#define RL_ISSTATE(x)          (rl_readline_state & (x))
10613  #ifdef __cplusplus
10615 Index: readline/rldefs.h
10616 ===================================================================
10617 RCS file: /prjz/.cvsroot/gdb/readline/rldefs.h,v
10618 retrieving revision 1.1.1.1
10619 diff -u -3 -p -r1.1.1.1 rldefs.h
10620 --- readline/rldefs.h   2003/02/16 21:36:31     1.1.1.1
10621 +++ readline/rldefs.h   2003/02/17 12:47:10
10622 @@ -30,6 +30,8 @@
10623  #  include "config.h"
10624  #endif
10626 +#include "rlstdc.h"
10628  #if defined (_POSIX_VERSION) && !defined (TERMIOS_MISSING)
10629  #  define TERMIOS_TTY_DRIVER
10630  #else
10631 @@ -70,8 +72,12 @@ extern char *strchr (), *strrchr ();
10632  #if defined (HAVE_STRCASECMP)
10633  #define _rl_stricmp strcasecmp
10634  #define _rl_strnicmp strncasecmp
10635 +#elif defined (__MINGW32__)
10636 +#define _rl_stricmp stricmp
10637 +#define _rl_strnicmp strnicmp
10638  #else
10639 -extern int _rl_stricmp (), _rl_strnicmp ();
10640 +extern int _rl_stricmp __P((char *, char *);
10641 +extern int _rl_strnicmp __P((char *, char *));
10642  #endif
10644  #if !defined (emacs_mode)
10645 @@ -87,14 +93,14 @@ extern int _rl_stricmp (), _rl_strnicmp 
10646     This is not what is wanted. */
10647  #if defined (CRAY)
10648  #  define FUNCTION_TO_KEYMAP(map, key) (Keymap)((int)map[key].function)
10649 -#  define KEYMAP_TO_FUNCTION(data)     (Function *)((int)(data))
10650 +#  define KEYMAP_TO_FUNCTION(data)     (rl_command_func_t *)((int)(data))
10651  #else
10652  #  define FUNCTION_TO_KEYMAP(map, key) (Keymap)(map[key].function)
10653 -#  define KEYMAP_TO_FUNCTION(data)     (Function *)(data)
10654 +#  define KEYMAP_TO_FUNCTION(data)     (rl_command_func_t *)(data)
10655  #endif
10657  #ifndef savestring
10658 -extern char *xmalloc ();
10659 +extern char *xmalloc __P((int));
10660  #define savestring(x) strcpy (xmalloc (1 + strlen (x)), (x))
10661  #endif
10663 @@ -130,6 +136,27 @@ extern char *xmalloc ();
10664  #  define FREE(x)      if (x) free (x)
10665  #endif
10667 +#if defined (__MINGW32__)
10668 +#define WAIT_FOR_INPUT 200     /* milliseconds to suspend maximally 
10669 +                                  when waiting for input */
10670 +#define FOR_INPUT      1       /* flags for open state of the console  */
10671 +#define FOR_OUTPUT     2
10672 +#define INITIALIZED    4
10674 +/* undefine this when readline / history should not look into the registry
10675 +   for the path to their init files  */
10676 +#define INITFILES_IN_REGISTRY 1
10678 +#if defined (INITFILES_IN_REGISTRY)
10679 +/* We also try to get the .inputrc and .history file paths from the registry,
10680 +   define what to look for */
10681 +#define READLINE_REGKEY        "Software\\Free Software Foundation\\libreadline"
10682 +#define INPUTRC_REGVAL "inputrc-file"
10683 +#define HISTFILE_REGVAL        "history-file"
10684 +#endif
10686 +#endif /* __MINGW32__  */
10688  /* CONFIGURATION SECTION */
10689  #include "rlconf.h"
10691 Index: readline/rlprivate.h
10692 ===================================================================
10693 RCS file: /prjz/.cvsroot/gdb/readline/rlprivate.h,v
10694 retrieving revision 1.1.1.1
10695 diff -u -3 -p -r1.1.1.1 rlprivate.h
10696 --- readline/rlprivate.h        2003/02/16 21:36:31     1.1.1.1
10697 +++ readline/rlprivate.h        2003/02/17 12:47:10
10698 @@ -24,6 +24,14 @@
10699  #if !defined (_RL_PRIVATE_H_)
10700  #define _RL_PRIVATE_H_
10702 +#if __READLINE_EXPORT__
10703 +# define READLINE_API __declspec (dllexport)
10704 +#elif __READLINE_IMPORT__
10705 +# define READLINE_API __declspec (dllimport)
10706 +#else
10707 +# define READLINE_API
10708 +#endif
10710  #include "rlconf.h"    /* for VISIBLE_STATS */
10711  #include "rlstdc.h"
10712  #include "posixjmp.h" /* defines procenv_t */
10713 @@ -35,7 +43,7 @@
10714   *************************************************************************/
10716  /* terminal.c */
10717 -extern char *rl_get_termcap __P((char *));
10718 +READLINE_API extern char *rl_get_termcap __P((const char *));
10720  /*************************************************************************
10721   *                                                                      *
10722 @@ -44,27 +52,23 @@ extern char *rl_get_termcap __P((char *)
10723   *************************************************************************/
10725  /* complete.c */
10726 -extern int rl_complete_with_tilde_expansion;
10727 +READLINE_API extern int rl_complete_with_tilde_expansion;
10728  #if defined (VISIBLE_STATS)
10729 -extern int rl_visible_stats;
10730 +READLINE_API extern int rl_visible_stats;
10731  #endif /* VISIBLE_STATS */
10733  /* readline.c */
10734 -extern int rl_line_buffer_len;
10735 -extern int rl_numeric_arg;
10736 -extern int rl_arg_sign;
10737 -extern int rl_explicit_arg;
10738 -extern int rl_editing_mode;
10739 -extern int rl_visible_prompt_length;
10740 -extern Function *rl_last_func;
10741 -extern int readline_echoing_p;
10742 -extern int rl_key_sequence_length;
10743 +READLINE_API extern int rl_line_buffer_len;
10744 +READLINE_API extern int rl_arg_sign;
10745 +READLINE_API extern int rl_visible_prompt_length;
10746 +READLINE_API extern int readline_echoing_p;
10747 +READLINE_API extern int rl_key_sequence_length;
10749  /* display.c */
10750 -extern int rl_display_fixed;
10751 +READLINE_API extern int rl_display_fixed;
10753  /* parens.c */
10754 -extern int rl_blink_matching_paren;
10755 +READLINE_API extern int rl_blink_matching_paren;
10757  /*************************************************************************
10758   *                                                                      *
10759 @@ -73,25 +77,25 @@ extern int rl_blink_matching_paren;
10760   *************************************************************************/
10762  /* bind.c */
10763 -extern char *rl_untranslate_keyseq __P((int));
10764 +READLINE_API extern char *rl_untranslate_keyseq __P((int));
10766  /* kill.c */
10767 -extern int rl_set_retained_kills __P((int));
10768 +READLINE_API extern int rl_set_retained_kills __P((int));
10770  /* readline.c */
10771 -extern int rl_discard_argument __P((void));
10772 +READLINE_API extern int rl_discard_argument __P((void));
10774  /* rltty.c */
10775 -extern int rl_stop_output __P((int, int));
10776 +READLINE_API extern int rl_stop_output __P((int, int));
10778  /* terminal.c */
10779 -extern void _rl_set_screen_size __P((int, int));
10780 +READLINE_API extern void _rl_set_screen_size __P((int, int));
10782  /* undo.c */
10783 -extern int _rl_fix_last_undo_of_type __P((int, int, int));
10784 +READLINE_API extern int _rl_fix_last_undo_of_type __P((int, int, int));
10786  /* util.c */
10787 -extern char *_rl_savestring __P((char *));
10788 +READLINE_API extern char *_rl_savestring __P((const char *));
10790  /*************************************************************************
10791   *                                                                      *
10792 @@ -111,161 +115,163 @@ extern char *_rl_savestring __P((char *)
10793  #if defined(READLINE_CALLBACKS)
10795  /* readline.c */
10796 -extern void readline_internal_setup __P((void));
10797 -extern char *readline_internal_teardown __P((int));
10798 -extern int readline_internal_char __P((void));
10799 +READLINE_API extern void readline_internal_setup __P((void));
10800 +READLINE_API extern char *readline_internal_teardown __P((int));
10801 +READLINE_API extern int readline_internal_char __P((void));
10803  #endif /* READLINE_CALLBACKS */
10805  /* bind.c */
10806 -extern void _rl_bind_if_unbound __P((char *, Function *));
10807 +READLINE_API extern void _rl_bind_if_unbound __P((const char *, rl_command_func_t *));
10809  /* display.c */
10810 -extern char *_rl_strip_prompt __P((char *));
10811 -extern void _rl_move_cursor_relative __P((int, char *));
10812 -extern void _rl_move_vert __P((int));
10813 -extern void _rl_save_prompt __P((void));
10814 -extern void _rl_restore_prompt __P((void));
10815 -extern char *_rl_make_prompt_for_search __P((int));
10816 -extern void _rl_erase_at_end_of_line __P((int));
10817 -extern void _rl_clear_to_eol __P((int));
10818 -extern void _rl_clear_screen __P((void));
10819 -extern void _rl_update_final __P((void));
10820 -extern void _rl_redisplay_after_sigwinch __P((void));
10821 -extern void _rl_clean_up_for_exit __P((void));
10822 -extern void _rl_erase_entire_line __P((void));
10823 -extern int _rl_currentb_display_line __P((void));
10824 +READLINE_API extern char *_rl_strip_prompt __P((char *));
10825 +READLINE_API extern void _rl_move_cursor_relative __P((int, const char *));
10826 +READLINE_API extern void _rl_move_vert __P((int));
10827 +READLINE_API extern void _rl_save_prompt __P((void));
10828 +READLINE_API extern void _rl_restore_prompt __P((void));
10829 +READLINE_API extern char *_rl_make_prompt_for_search __P((int));
10830 +READLINE_API extern void _rl_erase_at_end_of_line __P((int));
10831 +READLINE_API extern void _rl_clear_to_eol __P((int));
10832 +READLINE_API extern void _rl_clear_screen __P((void));
10833 +READLINE_API extern void _rl_update_final __P((void));
10834 +READLINE_API extern void _rl_redisplay_after_sigwinch __P((void));
10835 +READLINE_API extern void _rl_clean_up_for_exit __P((void));
10836 +READLINE_API extern void _rl_erase_entire_line __P((void));
10837 +READLINE_API extern int _rl_current_display_line __P((void));
10839  /* input.c */
10840 -extern int _rl_any_typein __P((void));
10841 -extern int _rl_input_available __P((void));
10842 -extern void _rl_insert_typein __P((int));
10843 +READLINE_API extern int _rl_any_typein __P((void));
10844 +READLINE_API extern int _rl_input_available __P((void));
10845 +READLINE_API extern void _rl_insert_typein __P((int));
10847  /* macro.c */
10848 -extern void _rl_with_macro_input __P((char *));
10849 -extern int _rl_next_macro_key __P((void));
10850 -extern void _rl_push_executing_macro __P((void));
10851 -extern void _rl_pop_executing_macro __P((void));
10852 -extern void _rl_add_macro_char __P((int));
10853 -extern void _rl_kill_kbd_macro __P((void));
10854 +READLINE_API extern void _rl_with_macro_input __P((char *));
10855 +READLINE_API extern int _rl_next_macro_key __P((void));
10856 +READLINE_API extern void _rl_push_executing_macro __P((void));
10857 +READLINE_API extern void _rl_pop_executing_macro __P((void));
10858 +READLINE_API extern void _rl_add_macro_char __P((int));
10859 +READLINE_API extern void _rl_kill_kbd_macro __P((void));
10861  /* nls.c */
10862 -extern int _rl_init_eightbit __P((void));
10863 +READLINE_API extern int _rl_init_eightbit __P((void));
10865  /* parens.c */
10866 -extern void _rl_enable_paren_matching __P((int));
10867 +READLINE_API extern void _rl_enable_paren_matching __P((int));
10869  /* readline.c */
10870 -extern void _rl_init_line_state __P((void));
10871 -extern void _rl_set_the_line __P((void));
10872 -extern int _rl_dispatch __P((int, Keymap));
10873 -extern int _rl_init_argument __P((void));
10874 -extern void _rl_fix_point __P((int));
10875 -extern void _rl_replace_text __P((char *, int, int));
10876 -extern int _rl_char_search_internal __P((int, int, int));
10877 -extern int _rl_set_mark_at_pos __P((int));
10878 +READLINE_API extern void _rl_init_line_state __P((void));
10879 +READLINE_API extern void _rl_set_the_line __P((void));
10880 +READLINE_API extern int _rl_dispatch __P((int, Keymap));
10881 +READLINE_API extern int _rl_init_argument __P((void));
10882 +READLINE_API extern void _rl_fix_point __P((int));
10883 +READLINE_API extern void _rl_replace_text __P((const char *, int, int));
10884 +READLINE_API extern int _rl_char_search_internal __P((int, int, int));
10885 +READLINE_API extern int _rl_set_mark_at_pos __P((int));
10886 +READLINE_API extern int _rl_free_saved_history_line __P((void));
10888  /* rltty.c */
10889 -extern int _rl_disable_tty_signals __P((void));
10890 -extern int _rl_restore_tty_signals __P((void));
10891 +READLINE_API extern int _rl_disable_tty_signals __P((void));
10892 +READLINE_API extern int _rl_restore_tty_signals __P((void));
10894  /* terminal.c */
10895 -extern void _rl_get_screen_size __P((int, int));
10896 -extern int _rl_init_terminal_io __P((char *));
10897 +READLINE_API extern void _rl_get_screen_size __P((int, int));
10898 +READLINE_API extern int _rl_init_terminal_io __P((const char *));
10899  #ifdef _MINIX
10900 -extern void _rl_output_character_function __P((int));
10901 +READLINE_API extern void _rl_output_character_function __P((int));
10902  #else
10903 -extern int _rl_output_character_function __P((int));
10904 +READLINE_API extern int _rl_output_character_function __P((int));
10905  #endif
10906 -extern void _rl_output_some_chars __P((char *, int));
10907 -extern int _rl_backspace __P((int));
10908 -extern void _rl_enable_meta_key __P((void));
10909 -extern void _rl_control_keypad __P((int));
10910 +READLINE_API extern void _rl_output_some_chars __P((const char *, int));
10911 +READLINE_API extern int _rl_backspace __P((int));
10912 +READLINE_API extern void _rl_enable_meta_key __P((void));
10913 +READLINE_API extern void _rl_control_keypad __P((int));
10915  /* util.c */
10916 -extern int alphabetic __P((int));
10917 -extern int _rl_abort_internal __P((void));
10918 -extern char *_rl_strindex __P((char *, char *));
10919 -extern int _rl_qsort_string_compare __P((char **, char **));
10920 -extern int (_rl_uppercase_p) __P((int));
10921 -extern int (_rl_lowercase_p) __P((int));
10922 -extern int (_rl_pure_alphabetic) __P((int));
10923 -extern int (_rl_digit_p) __P((int));
10924 -extern int (_rl_to_lower) __P((int));
10925 -extern int (_rl_to_upper) __P((int));
10926 -extern int (_rl_digit_value) __P((int));
10927 +READLINE_API extern int rl_alphabetic __P((int));
10928 +READLINE_API extern int _rl_abort_internal __P((void));
10929 +READLINE_API extern char *_rl_strindex __P((const char *, const char *));
10930 +READLINE_API extern char *_rl_strpbrk __P((const char *, const char *));
10931 +READLINE_API extern int _rl_qsort_string_compare __P((char **, char **));
10932 +READLINE_API extern int (_rl_uppercase_p) __P((int));
10933 +READLINE_API extern int (_rl_lowercase_p) __P((int));
10934 +READLINE_API extern int (_rl_pure_alphabetic) __P((int));
10935 +READLINE_API extern int (_rl_digit_p) __P((int));
10936 +READLINE_API extern int (_rl_to_lower) __P((int));
10937 +READLINE_API extern int (_rl_to_upper) __P((int));
10938 +READLINE_API extern int (_rl_digit_value) __P((int));
10940  /* vi_mode.c */
10941 -extern void _rl_vi_initialize_line __P((void));
10942 -extern void _rl_vi_reset_last __P((void));
10943 -extern void _rl_vi_set_last __P((int, int, int));
10944 -extern int _rl_vi_textmod_command __P((int));
10945 -extern void _rl_vi_done_inserting __P((void));
10946 +READLINE_API extern void _rl_vi_initialize_line __P((void));
10947 +READLINE_API extern void _rl_vi_reset_last __P((void));
10948 +READLINE_API extern void _rl_vi_set_last __P((int, int, int));
10949 +READLINE_API extern int _rl_vi_textmod_command __P((int));
10950 +READLINE_API extern void _rl_vi_done_inserting __P((void));
10952  /*************************************************************************
10953   * Undocumented private variables                                       *
10954   *************************************************************************/
10956 +/* bind.c */
10957 +READLINE_API extern const char *_rl_possible_control_prefixes[];
10958 +READLINE_API extern const char *_rl_possible_meta_prefixes[];
10960  /* complete.c */
10961 -extern int _rl_complete_show_all;
10962 -extern int _rl_complete_mark_directories;
10963 -extern int _rl_print_completions_horizontally;
10964 -extern int _rl_completion_case_fold;
10965 +READLINE_API extern int _rl_complete_show_all;
10966 +READLINE_API extern int _rl_complete_mark_directories;
10967 +READLINE_API extern int _rl_print_completions_horizontally;
10968 +READLINE_API extern int _rl_completion_case_fold;
10970  /* display.c */
10971 -extern int _rl_vis_botlin;
10972 -extern int _rl_last_c_pos;
10973 -extern int _rl_suppress_redisplay;
10974 -extern char *rl_display_prompt;
10976 -/* funmap.c */
10977 -extern char *possible_control_prefixes[];
10978 -extern char *possible_meta_prefixes[];
10979 +READLINE_API extern int _rl_vis_botlin;
10980 +READLINE_API extern int _rl_last_c_pos;
10981 +READLINE_API extern int _rl_suppress_redisplay;
10982 +READLINE_API extern char *rl_display_prompt;
10984  /* isearch.c */
10985 -extern unsigned char *_rl_isearch_terminators;
10986 +READLINE_API extern unsigned char *_rl_isearch_terminators;
10988  /* macro.c */
10989 -extern int _rl_defining_kbd_macro;
10990 -extern char *_rl_executing_macro;
10991 +READLINE_API extern int _rl_defining_kbd_macro;
10992 +READLINE_API extern char *_rl_executing_macro;
10994  /* readline.c */
10995 -extern int _rl_horizontal_scroll_mode;
10996 -extern int _rl_mark_modified_lines;
10997 -extern int _rl_bell_preference;
10998 -extern int _rl_meta_flag;
10999 -extern int _rl_convert_meta_chars_to_ascii;
11000 -extern int _rl_output_meta_chars;
11001 -extern char *_rl_comment_begin;
11002 -extern unsigned char _rl_parsing_conditionalized_out;
11003 -extern Keymap _rl_keymap;
11004 -extern FILE *_rl_in_stream;
11005 -extern FILE *_rl_out_stream;
11006 -extern int _rl_last_command_was_kill;
11007 -extern int _rl_eof_char;
11008 -extern procenv_t readline_top_level;
11009 +READLINE_API extern int _rl_horizontal_scroll_mode;
11010 +READLINE_API extern int _rl_mark_modified_lines;
11011 +READLINE_API extern int _rl_bell_preference;
11012 +READLINE_API extern int _rl_meta_flag;
11013 +READLINE_API extern int _rl_convert_meta_chars_to_ascii;
11014 +READLINE_API extern int _rl_output_meta_chars;
11015 +READLINE_API extern char *_rl_comment_begin;
11016 +READLINE_API extern unsigned char _rl_parsing_conditionalized_out;
11017 +READLINE_API extern Keymap _rl_keymap;
11018 +READLINE_API extern FILE *_rl_in_stream;
11019 +READLINE_API extern FILE *_rl_out_stream;
11020 +READLINE_API extern int _rl_last_command_was_kill;
11021 +READLINE_API extern int _rl_eof_char;
11022 +READLINE_API extern procenv_t readline_top_level;
11024  /* terminal.c */
11025 -extern int _rl_enable_keypad;
11026 -extern int _rl_enable_meta;
11027 -extern char *term_clreol;
11028 -extern char *term_clrpag;
11029 -extern char *term_im;
11030 -extern char *term_ic;
11031 -extern char *term_ei;
11032 -extern char *term_DC;
11033 -extern char *term_up;
11034 -extern char *term_dc;
11035 -extern char *term_cr;
11036 -extern char *term_IC;
11037 -extern int screenheight;
11038 -extern int screenwidth;
11039 -extern int screenchars;
11040 -extern int terminal_can_insert;
11041 -extern int _rl_term_autowrap;
11042 +READLINE_API extern int _rl_enable_keypad;
11043 +READLINE_API extern int _rl_enable_meta;
11044 +READLINE_API extern char *_rl_term_clreol;
11045 +READLINE_API extern char *_rl_term_clrpag;
11046 +READLINE_API extern char *_rl_term_im;
11047 +READLINE_API extern char *_rl_term_ic;
11048 +READLINE_API extern char *_rl_term_ei;
11049 +READLINE_API extern char *_rl_term_DC;
11050 +READLINE_API extern char *_rl_term_up;
11051 +READLINE_API extern char *_rl_term_dc;
11052 +READLINE_API extern char *_rl_term_cr;
11053 +READLINE_API extern char *_rl_term_IC;
11054 +READLINE_API extern int _rl_screenheight;
11055 +READLINE_API extern int _rl_screenwidth;
11056 +READLINE_API extern int _rl_screenchars;
11057 +READLINE_API extern int _rl_terminal_can_insert;
11058 +READLINE_API extern int _rl_term_autowrap;
11060  /* undo.c */
11061 -extern int _rl_doing_an_undo;
11062 -extern int _rl_undo_group_level;
11063 +READLINE_API extern int _rl_doing_an_undo;
11064 +READLINE_API extern int _rl_undo_group_level;
11066  #endif /* _RL_PRIVATE_H_ */
11067 Index: readline/rlshell.h
11068 ===================================================================
11069 RCS file: /prjz/.cvsroot/gdb/readline/rlshell.h,v
11070 retrieving revision 1.1.1.1
11071 diff -u -3 -p -r1.1.1.1 rlshell.h
11072 --- readline/rlshell.h  2003/02/16 21:36:31     1.1.1.1
11073 +++ readline/rlshell.h  2000/11/08 15:51:03
11074 @@ -25,10 +25,10 @@
11076  #include "rlstdc.h"
11078 -extern char *single_quote __P((char *));
11079 -extern void set_lines_and_columns __P((int, int));
11080 -extern char *get_env_value __P((char *));
11081 -extern char *get_home_dir __P((void));
11082 -extern int unset_nodelay_mode __P((int));
11083 +extern char *sh_single_quote __P((char *));
11084 +extern void sh_set_lines_and_columns __P((int, int));
11085 +extern char *sh_get_env_value __P((const char *));
11086 +extern char *sh_get_home_dir __P((void));
11087 +extern int sh_unset_nodelay_mode __P((int));
11089  #endif /* _RL_SHELL_H_ */
11090 Index: readline/rlstdc.h
11091 ===================================================================
11092 RCS file: /prjz/.cvsroot/gdb/readline/rlstdc.h,v
11093 retrieving revision 1.1.1.1
11094 diff -u -3 -p -r1.1.1.1 rlstdc.h
11095 --- readline/rlstdc.h   2003/02/16 21:36:31     1.1.1.1
11096 +++ readline/rlstdc.h   2000/09/13 18:10:14
11097 @@ -36,4 +36,16 @@
11098  #  endif
11099  #endif
11101 +#if !defined (__STDC__) && !defined (__cplusplus)
11102 +#  if defined (__GNUC__)       /* gcc with -traditional */
11103 +#    if !defined (const)
11104 +#      define const __const
11105 +#    endif /* !const */
11106 +#  else /* !__GNUC__ */
11107 +#    if !defined (const)
11108 +#      define const
11109 +#    endif /* !const */
11110 +#  endif /* !__GNUC__ */
11111 +#endif /* !__STDC__ && !__cplusplus */
11113  #endif /* !_RL_STDC_H_ */
11114 Index: readline/rltty.c
11115 ===================================================================
11116 RCS file: /prjz/.cvsroot/gdb/readline/rltty.c,v
11117 retrieving revision 1.1.1.1
11118 diff -u -3 -p -r1.1.1.1 rltty.c
11119 --- readline/rltty.c    2003/02/16 21:36:32     1.1.1.1
11120 +++ readline/rltty.c    2003/02/17 12:47:10
11121 @@ -26,6 +26,8 @@
11122  #  include <config.h>
11123  #endif
11125 +#if !defined (__MINGW32__)     /* for native Win32 environments this is hard stuff  */
11127  #include <sys/types.h>
11128  #include <signal.h>
11129  #include <errno.h>
11130 @@ -42,6 +44,10 @@
11131  #endif /* GWINSZ_IN_SYS_IOCTL */
11133  #include "rltty.h"
11134 +#else  /* __MINGW32__ */
11135 +#include "rldefs.h"
11136 +#include <stdio.h>
11137 +#endif /* __MINGW32__ */
11138  #include "readline.h"
11139  #include "rlprivate.h"
11141 @@ -49,9 +55,10 @@
11142  extern int errno;
11143  #endif /* !errno */
11145 -VFunction *rl_prep_term_function = rl_prep_terminal;
11146 -VFunction *rl_deprep_term_function = rl_deprep_terminal;
11147 +rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
11148 +rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
11150 +#ifndef __MINGW32__
11151  /* **************************************************************** */
11152  /*                                                                 */
11153  /*                        Signal Management                        */
11154 @@ -214,28 +221,27 @@ get_tty_settings (tty, tiop)
11155       int tty;
11156       TIOTYPE *tiop;
11158 -#if defined (TIOCGWINSZ)
11159    set_winsize (tty);
11160 -#endif
11162    tiop->flags = tiop->lflag = 0;
11164 -  ioctl (tty, TIOCGETP, &(tiop->sgttyb));
11165 +  if (ioctl (tty, TIOCGETP, &(tiop->sgttyb)) < 0)
11166 +    return -1;
11167    tiop->flags |= SGTTY_SET;
11169  #if defined (TIOCLGET)
11170 -  ioctl (tty, TIOCLGET, &(tiop->lflag));
11171 -  tiop->flags |= LFLAG_SET;
11172 +  if (ioctl (tty, TIOCLGET, &(tiop->lflag)) == 0)
11173 +    tiop->flags |= LFLAG_SET;
11174  #endif
11176  #if defined (TIOCGETC)
11177 -  ioctl (tty, TIOCGETC, &(tiop->tchars));
11178 -  tiop->flags |= TCHARS_SET;
11179 +  if (ioctl (tty, TIOCGETC, &(tiop->tchars)) == 0)
11180 +    tiop->flags |= TCHARS_SET;
11181  #endif
11183  #if defined (TIOCGLTC)
11184 -  ioctl (tty, TIOCGLTC, &(tiop->ltchars));
11185 -  tiop->flags |= LTCHARS_SET;
11186 +  if (ioctl (tty, TIOCGLTC, &(tiop->ltchars)) == 0)
11187 +    tiop->flags |= LTCHARS_SET;
11188  #endif
11190    return 0;
11191 @@ -281,23 +287,23 @@ set_tty_settings (tty, tiop)
11194  static void
11195 -prepare_terminal_settings (meta_flag, otio, tiop)
11196 +prepare_terminal_settings (meta_flag, oldtio, tiop)
11197       int meta_flag;
11198 -     TIOTYPE otio, *tiop;
11199 +     TIOTYPE oldtio, *tiop;
11201 -  readline_echoing_p = (otio.sgttyb.sg_flags & ECHO);
11202 +  readline_echoing_p = (oldtio.sgttyb.sg_flags & ECHO);
11204    /* Copy the original settings to the structure we're going to use for
11205       our settings. */
11206 -  tiop->sgttyb = otio.sgttyb;
11207 -  tiop->lflag = otio.lflag;
11208 +  tiop->sgttyb = oldtio.sgttyb;
11209 +  tiop->lflag = oldtio.lflag;
11210  #if defined (TIOCGETC)
11211 -  tiop->tchars = otio.tchars;
11212 +  tiop->tchars = oldtio.tchars;
11213  #endif
11214  #if defined (TIOCGLTC)
11215 -  tiop->ltchars = otio.ltchars;
11216 +  tiop->ltchars = oldtio.ltchars;
11217  #endif
11218 -  tiop->flags = otio.flags;
11219 +  tiop->flags = oldtio.flags;
11221    /* First, the basic settings to put us into character-at-a-time, no-echo
11222       input mode. */
11223 @@ -310,8 +316,8 @@ prepare_terminal_settings (meta_flag, ot
11224  #if !defined (ANYP)
11225  #  define ANYP (EVENP | ODDP)
11226  #endif
11227 -  if (((otio.sgttyb.sg_flags & ANYP) == ANYP) ||
11228 -      ((otio.sgttyb.sg_flags & ANYP) == 0))
11229 +  if (((oldtio.sgttyb.sg_flags & ANYP) == ANYP) ||
11230 +      ((oldtio.sgttyb.sg_flags & ANYP) == 0))
11231      {
11232        tiop->sgttyb.sg_flags |= ANYP;
11234 @@ -330,13 +336,13 @@ prepare_terminal_settings (meta_flag, ot
11235    tiop->tchars.t_startc = -1; /* C-q */
11237    /* If there is an XON character, bind it to restart the output. */
11238 -  if (otio.tchars.t_startc != -1)
11239 -    rl_bind_key (otio.tchars.t_startc, rl_restart_output);
11240 +  if (oldtio.tchars.t_startc != -1)
11241 +    rl_bind_key (oldtio.tchars.t_startc, rl_restart_output);
11242  #  endif /* USE_XON_XOFF */
11244    /* If there is an EOF char, bind _rl_eof_char to it. */
11245 -  if (otio.tchars.t_eofc != -1)
11246 -    _rl_eof_char = otio.tchars.t_eofc;
11247 +  if (oldtio.tchars.t_eofc != -1)
11248 +    _rl_eof_char = oldtio.tchars.t_eofc;
11250  #  if defined (NO_KILL_INTR)
11251    /* Get rid of terminal-generated SIGQUIT and SIGINT. */
11252 @@ -375,7 +381,7 @@ prepare_terminal_settings (meta_flag, ot
11253  #  define TIOTYPE struct termio
11254  #  define DRAIN_OUTPUT(fd)
11255  #  define GETATTR(tty, tiop)   (ioctl (tty, TCGETA, tiop))
11256 -#  define SETATTR(tty, tiop)   (ioctl (tty, TCSETA, tiop))
11257 +#  define SETATTR(tty, tiop)   (ioctl (tty, TCSETAW, tiop))
11258  #endif /* !TERMIOS_TTY_DRIVER */
11260  static TIOTYPE otio;
11261 @@ -491,9 +497,7 @@ get_tty_settings (tty, tiop)
11262       int tty;
11263       TIOTYPE *tiop;
11265 -#if defined (TIOCGWINSZ)
11266    set_winsize (tty);
11267 -#endif
11269    if (_get_tty_settings (tty, tiop) < 0)
11270      return -1;
11271 @@ -549,16 +553,16 @@ set_tty_settings (tty, tiop)
11274  static void
11275 -prepare_terminal_settings (meta_flag, otio, tiop)
11276 +prepare_terminal_settings (meta_flag, oldtio, tiop)
11277       int meta_flag;
11278 -     TIOTYPE otio, *tiop;
11279 +     TIOTYPE oldtio, *tiop;
11281 -  readline_echoing_p = (otio.c_lflag & ECHO);
11282 +  readline_echoing_p = (oldtio.c_lflag & ECHO);
11284    tiop->c_lflag &= ~(ICANON | ECHO);
11286 -  if ((unsigned char) otio.c_cc[VEOF] != (unsigned char) _POSIX_VDISABLE)
11287 -    _rl_eof_char = otio.c_cc[VEOF];
11288 +  if ((unsigned char) oldtio.c_cc[VEOF] != (unsigned char) _POSIX_VDISABLE)
11289 +    _rl_eof_char = oldtio.c_cc[VEOF];
11291  #if defined (USE_XON_XOFF)
11292  #if defined (IXANY)
11293 @@ -589,7 +593,7 @@ prepare_terminal_settings (meta_flag, ot
11294    if (OUTPUT_BEING_FLUSHED (tiop))
11295      {
11296        tiop->c_lflag &= ~FLUSHO;
11297 -      otio.c_lflag &= ~FLUSHO;
11298 +      oldtio.c_lflag &= ~FLUSHO;
11299      }
11300  #endif
11302 @@ -649,6 +653,7 @@ rl_prep_terminal (meta_flag)
11304    fflush (rl_outstream);
11305    terminal_prepped = 1;
11306 +  RL_SETSTATE(RL_STATE_TERMPREPPED);
11308    release_sigint ();
11310 @@ -679,6 +684,7 @@ rl_deprep_terminal ()
11311      }
11313    terminal_prepped = 0;
11314 +  RL_UNSETSTATE(RL_STATE_TERMPREPPED);
11316    release_sigint ();
11318 @@ -755,6 +761,9 @@ rl_stop_output (count, key)
11319  /*                     Default Key Bindings                        */
11320  /*                                                                 */
11321  /* **************************************************************** */
11323 +/* Set the system's default editing characters to their readline equivalents
11324 +   in KMAP.  Should be static, now that we have rl_tty_set_default_bindings. */
11325  void
11326  rltty_set_default_bindings (kmap)
11327       Keymap kmap;
11328 @@ -817,6 +826,124 @@ rltty_set_default_bindings (kmap)
11329  #  endif /* VWERASE && TERMIOS_TTY_DRIVER */
11330      }
11331  #endif /* !NEW_TTY_DRIVER */
11334 +#else /* __MING32__ */
11336 +/* **************************************************************** */
11337 +/*                                                                 */
11338 +/*             Default Key Bindings for Win32 Console              */
11339 +/*                                                                 */
11340 +/* **************************************************************** */
11342 +#include <windows.h>
11344 +#define CONSOLE_MODE   ENABLE_PROCESSED_INPUT | ENABLE_MOUSE_INPUT
11346 +/* global vars used by other modules */
11348 +int    haveConsole     = 0;    /* remember init result of the console  */
11349 +HANDLE hStdout, hStdin;        /* these are different from stdin, stdout  */
11351 +COORD  rlScreenOrigin;         /* readline origin in frame buffer coordinates */
11352 +int    rlScreenStart = 0;      /* readline origin as frame screen buffer offset */
11353 +COORD  rlScreenEnd;            /* end of line in frame buffer coordinates */
11354 +int    rlScreenMax = 0;        /* end of line as linear frame buffer offset */
11356 +static DWORD savedConsoleMode = 0;     /* to restore console on exit */
11358 +void
11359 +rltty_set_default_bindings (kmap)
11360 +     Keymap kmap;
11362 +  /* I bet this is required on Win32 ;-) */
11363 +  {
11364 +    char buf[40]; strcpy(buf,"set bell-style none");
11365 +    rl_parse_and_bind(buf);
11366 +  }
11367 +  rl_set_key ("\\M-\\ø&", rl_get_previous_history, kmap);
11368 +  rl_set_key ("\\M-\\ø(", rl_get_next_history, kmap);
11369 +  rl_set_key ("\\M-\\ø'", rl_forward, kmap);
11370 +  rl_set_key ("\\M-\\ø%", rl_backward, kmap);
11371 +  
11372 +  rl_set_key ("\\M-\\ø$", rl_beg_of_line, kmap);
11373 +  rl_set_key ("\\M-\\ø#", rl_end_of_line, kmap);
11374 +  rl_set_key ("\\M-\\ú%", rl_backward_word, kmap);
11375 +  rl_set_key ("\\M-\\ú'", rl_forward_word, kmap);
11376 +  
11377 +  rl_set_key ("\\M-\\ù-", rl_paste_from_clipboard, kmap);
11378 +  rl_set_key ("\\M-\\ø.", rl_delete, kmap);
11379 +  rl_set_key ("\x16", rl_unix_word_rubout, kmap);
11382 +/* Query and set up a Window Console */
11384 +void
11385 +rl_prep_terminal (meta_flag)
11386 +     int meta_flag;
11388 +  readline_echoing_p = 1;
11389 +  
11390 +  if ( !(haveConsole & INITIALIZED) )
11391 +    {
11392 +      if ( !(haveConsole & FOR_INPUT)
11393 +          && ((hStdin = GetStdHandle(STD_INPUT_HANDLE)) != INVALID_HANDLE_VALUE) )
11394 +        {
11395 +          DWORD dummy;
11396 +          INPUT_RECORD irec;
11397 +          if ( PeekConsoleInput(hStdin, &irec, 1, &dummy) )
11398 +            {
11399 +              haveConsole |= FOR_INPUT;
11400 +              if ( GetConsoleMode(hStdin, &savedConsoleMode) )
11401 +                SetConsoleMode(hStdin, CONSOLE_MODE);
11402 +            }
11403 +        }
11404 +      if ( (hStdout = GetStdHandle(STD_OUTPUT_HANDLE)) != INVALID_HANDLE_VALUE)
11405 +        {
11406 +          CONSOLE_SCREEN_BUFFER_INFO csbi;
11407 +          if ( GetConsoleScreenBufferInfo(hStdout, &csbi) 
11408 +               && (csbi.dwSize.X > 0) && (csbi.dwSize.Y > 0) )
11409 +            {
11410 +              haveConsole |= FOR_OUTPUT;
11411 +              rlScreenOrigin = csbi.dwCursorPosition;
11412 +              rlScreenStart = (int)csbi.dwCursorPosition.Y * (int)csbi.dwSize.X
11413 +               + (int)csbi.dwCursorPosition.X;
11414 +            }
11415 +        }
11416 +      haveConsole |= INITIALIZED;
11417 +    }
11420 +/* Restore the consoles's normal settings and modes. */
11421 +void
11422 +rl_deprep_terminal ()
11424 +  SetConsoleMode(hStdin, savedConsoleMode);
11425 +  haveConsole = 0;
11428 +int
11429 +rl_restart_output (count, key)
11430 +     int count, key;
11432 +  return 0;
11435 +int
11436 +rl_stop_output (count, key)
11437 +     int count, key;
11439 +  return 0;
11441 +#endif /* __MINGW32__ */
11443 +/* New public way to set the system default editing chars to their readline
11444 +   equivalents. */
11445 +void
11446 +rl_tty_set_default_bindings (kmap)
11447 +     Keymap kmap;
11449 +  rltty_set_default_bindings (kmap);
11452  #if defined (HANDLE_SIGNALS)
11453 Index: readline/rltty.h
11454 ===================================================================
11455 RCS file: /prjz/.cvsroot/gdb/readline/rltty.h,v
11456 retrieving revision 1.1.1.1
11457 diff -u -3 -p -r1.1.1.1 rltty.h
11458 --- readline/rltty.h    2003/02/16 21:36:32     1.1.1.1
11459 +++ readline/rltty.h    2003/02/17 12:47:10
11460 @@ -38,7 +38,7 @@
11461  #endif /* TERMIO_TTY_DRIVER */
11463  /* Other (BSD) machines use sgtty. */
11464 -#if defined (NEW_TTY_DRIVER)
11465 +#if defined (NEW_TTY_DRIVER) && !defined (__MINGW32__)
11466  #  include <sgtty.h>
11467  #endif
11469 Index: readline/savestring.c
11470 ===================================================================
11471 RCS file: /prjz/.cvsroot/gdb/readline/savestring.c,v
11472 retrieving revision 1.1.1.1
11473 diff -u -3 -p -r1.1.1.1 savestring.c
11474 --- readline/savestring.c       2003/02/16 21:36:32     1.1.1.1
11475 +++ readline/savestring.c       2000/09/14 18:58:41
11476 @@ -27,7 +27,7 @@ extern char *xmalloc ();
11477     all `public' readline header files. */
11478  char *
11479  savestring (s)
11480 -     char *s;
11481 +     const char *s;
11483    return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
11485 Index: readline/search.c
11486 ===================================================================
11487 RCS file: /prjz/.cvsroot/gdb/readline/search.c,v
11488 retrieving revision 1.1.1.1
11489 diff -u -3 -p -r1.1.1.1 search.c
11490 --- readline/search.c   2003/02/16 21:36:32     1.1.1.1
11491 +++ readline/search.c   2000/11/02 18:13:25
11492 @@ -51,7 +51,7 @@
11493  #endif
11494  #define abs(x)         (((x) >= 0) ? (x) : -(x))
11496 -extern HIST_ENTRY *saved_line_for_history;
11497 +extern HIST_ENTRY *_rl_saved_line_for_history;
11499  /* Functions imported from the rest of the library. */
11500  extern int _rl_free_history_entry __P((HIST_ENTRY *));
11501 @@ -83,9 +83,9 @@ make_history_line_current (entry)
11502    rl_undo_list = (UNDO_LIST *)entry->data;
11503    rl_end = line_len;
11505 -  if (saved_line_for_history)
11506 -    _rl_free_history_entry (saved_line_for_history);
11507 -  saved_line_for_history = (HIST_ENTRY *)NULL;
11508 +  if (_rl_saved_line_for_history)
11509 +    _rl_free_history_entry (_rl_saved_line_for_history);
11510 +  _rl_saved_line_for_history = (HIST_ENTRY *)NULL;
11513  /* Search the history list for STRING starting at absolute history position
11514 @@ -100,13 +100,19 @@ noninc_search_from_pos (string, pos, dir
11516    int ret, old;
11518 +  if (pos < 0)
11519 +    return -1;
11521    old = where_history ();
11522 -  history_set_pos (pos);
11523 +  if (history_set_pos (pos) == 0)
11524 +    return -1;
11526 +  RL_SETSTATE(RL_STATE_SEARCH);
11527    if (*string == '^')
11528      ret = history_search_prefix (string + 1, dir);
11529    else
11530      ret = history_search (string, dir);
11531 +  RL_UNSETSTATE(RL_STATE_SEARCH);
11533    if (ret != -1)
11534      ret = where_history ();
11535 @@ -128,7 +134,7 @@ noninc_dosearch (string, dir)
11537    if (string == 0 || *string == '\0' || noninc_history_pos < 0)
11538      {
11539 -      ding ();
11540 +      rl_ding ();
11541        return;
11542      }
11544 @@ -136,10 +142,10 @@ noninc_dosearch (string, dir)
11545    if (pos == -1)
11546      {
11547        /* Search failed, current history position unchanged. */
11548 -      maybe_unsave_line ();
11549 +      rl_maybe_unsave_line ();
11550        rl_clear_message ();
11551        rl_point = 0;
11552 -      ding ();
11553 +      rl_ding ();
11554        return;
11555      }
11557 @@ -172,7 +178,7 @@ noninc_search (dir, pchar)
11558    int saved_point, c;
11559    char *p;
11561 -  maybe_save_line ();
11562 +  rl_maybe_save_line ();
11563    saved_point = rl_point;
11565    /* Use the line buffer to read the search string. */
11566 @@ -183,18 +189,26 @@ noninc_search (dir, pchar)
11567    rl_message (p, 0, 0);
11568    free (p);
11570 -#define SEARCH_RETURN rl_restore_prompt (); return
11571 +#define SEARCH_RETURN rl_restore_prompt (); RL_UNSETSTATE(RL_STATE_NSEARCH); return
11573 +  RL_SETSTATE(RL_STATE_NSEARCH);
11574    /* Read the search string. */
11575 -  while (c = rl_read_key ())
11576 +  while (1)
11577      {
11578 +      RL_SETSTATE(RL_STATE_MOREINPUT);
11579 +      c = rl_read_key ();
11580 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
11582 +      if (c == 0)
11583 +       break;
11585        switch (c)
11586         {
11587         case CTRL('H'):
11588         case RUBOUT:
11589           if (rl_point == 0)
11590             {
11591 -             maybe_unsave_line ();
11592 +             rl_maybe_unsave_line ();
11593               rl_clear_message ();
11594               rl_point = saved_point;
11595               SEARCH_RETURN;
11596 @@ -218,10 +232,10 @@ noninc_search (dir, pchar)
11598         case CTRL('C'):
11599         case CTRL('G'):
11600 -         maybe_unsave_line ();
11601 +         rl_maybe_unsave_line ();
11602           rl_clear_message ();
11603           rl_point = saved_point;
11604 -         ding ();
11605 +         rl_ding ();
11606           SEARCH_RETURN;
11608         default:
11609 @@ -239,7 +253,7 @@ noninc_search (dir, pchar)
11610      {
11611        if (!noninc_search_string)
11612         {
11613 -         ding ();
11614 +         rl_ding ();
11615           SEARCH_RETURN;
11616         }
11617      }
11618 @@ -253,6 +267,7 @@ noninc_search (dir, pchar)
11620    rl_restore_prompt ();
11621    noninc_dosearch (noninc_search_string, dir);
11622 +  RL_UNSETSTATE(RL_STATE_NSEARCH);
11625  /* Search forward through the history list for a string.  If the vi-mode
11626 @@ -283,7 +298,7 @@ rl_noninc_forward_search_again (count, k
11628    if (!noninc_search_string)
11629      {
11630 -      ding ();
11631 +      rl_ding ();
11632        return (-1);
11633      }
11634    noninc_dosearch (noninc_search_string, 1);
11635 @@ -298,7 +313,7 @@ rl_noninc_reverse_search_again (count, k
11637    if (!noninc_search_string)
11638      {
11639 -      ding ();
11640 +      rl_ding ();
11641        return (-1);
11642      }
11643    noninc_dosearch (noninc_search_string, -1);
11644 @@ -312,7 +327,7 @@ rl_history_search_internal (count, dir)
11645    HIST_ENTRY *temp;
11646    int ret, oldpos;
11648 -  maybe_save_line ();
11649 +  rl_maybe_save_line ();
11650    temp = (HIST_ENTRY *)NULL;
11652    /* Search COUNT times through the history for a line whose prefix
11653 @@ -341,8 +356,8 @@ rl_history_search_internal (count, dir)
11654    /* If we didn't find anything at all, return. */
11655    if (temp == 0)
11656      {
11657 -      maybe_unsave_line ();
11658 -      ding ();
11659 +      rl_maybe_unsave_line ();
11660 +      rl_ding ();
11661        /* If you don't want the saved history line (last match) to show up
11662           in the line buffer after the search fails, change the #if 0 to
11663           #if 1 */
11664 @@ -353,7 +368,7 @@ rl_history_search_internal (count, dir)
11665            rl_line_buffer[rl_end] = '\0';
11666          }
11667  #else
11668 -      rl_point = rl_history_search_len;        /* maybe_unsave_line changes it */
11669 +      rl_point = rl_history_search_len;        /* rl_maybe_unsave_line changes it */
11670  #endif
11671        return 1;
11672      }
11673 @@ -382,6 +397,7 @@ rl_history_search_reinit ()
11674        strncpy (history_search_string + 1, rl_line_buffer, rl_point);
11675        history_search_string[rl_point + 1] = '\0';
11676      }
11677 +  _rl_free_saved_history_line ();
11680  /* Search forward in the history for the string of characters
11681 Index: readline/shell.c
11682 ===================================================================
11683 RCS file: /prjz/.cvsroot/gdb/readline/shell.c,v
11684 retrieving revision 1.1.1.1
11685 diff -u -3 -p -r1.1.1.1 shell.c
11686 --- readline/shell.c    2003/02/16 21:36:32     1.1.1.1
11687 +++ readline/shell.c    2003/02/17 12:47:10
11688 @@ -27,7 +27,6 @@
11689  #endif
11691  #include <sys/types.h>
11692 -#include <stdio.h>
11694  #if defined (HAVE_UNISTD_H)
11695  #  include <unistd.h>
11696 @@ -46,15 +45,20 @@
11697  #endif /* !HAVE_STRING_H */
11699  #include <fcntl.h>
11700 +#ifndef __MINGW32__
11701  #include <pwd.h>
11702 +#else
11703 +#include <windows.h>
11704 +#endif
11706  #include <stdio.h>
11708 +#include "rlstdc.h"
11709  #include "rlshell.h"
11710  #include "xmalloc.h"
11712  #if !defined (HAVE_GETPW_DECLS)
11713 -extern struct passwd *getpwuid ();
11714 +extern struct passwd *getpwuid __P((uid_t));
11715  #endif /* !HAVE_GETPW_DECLS */
11717  #ifndef NULL
11718 @@ -66,7 +70,7 @@ extern struct passwd *getpwuid ();
11720  /* Does shell-like quoting using single quotes. */
11721  char *
11722 -single_quote (string)
11723 +sh_single_quote (string)
11724       char *string;
11726    register int c;
11727 @@ -97,7 +101,7 @@ single_quote (string)
11728  /* Set the environment variables LINES and COLUMNS to lines and cols,
11729     respectively. */
11730  void
11731 -set_lines_and_columns (lines, cols)
11732 +sh_set_lines_and_columns (lines, cols)
11733       int lines, cols;
11735    char *b;
11736 @@ -122,22 +126,26 @@ set_lines_and_columns (lines, cols)
11739  char *
11740 -get_env_value (varname)
11741 -     char *varname;
11742 +sh_get_env_value (varname)
11743 +     const char *varname;
11745    return ((char *)getenv (varname));
11748  char *
11749 -get_home_dir ()
11750 +sh_get_home_dir ()
11752    char *home_dir;
11753 +#ifndef __MINGW32__
11754    struct passwd *entry;
11756    home_dir = (char *)NULL;
11757    entry = getpwuid (getuid ());
11758    if (entry)
11759      home_dir = entry->pw_dir;
11760 +#else
11761 +  home_dir = sh_get_env_value ("HOME");
11762 +#endif
11763    return (home_dir);
11766 @@ -147,8 +155,9 @@ get_home_dir ()
11767  #  endif
11768  #endif
11770 +#ifndef __MINGW32__
11771  int
11772 -unset_nodelay_mode (fd)
11773 +sh_unset_nodelay_mode (fd)
11774       int fd;
11776    int flags, bflags;
11777 @@ -174,3 +183,30 @@ unset_nodelay_mode (fd)
11779    return 0;
11782 +#else  /* __MINGW32__  */
11783 +char *
11784 +get_user_registry_string(char *keyName, char* valName)
11786 +  char *result = NULL;
11787 +  HKEY subKey;
11788 +  if ( keyName && (RegOpenKeyEx(HKEY_CURRENT_USER, keyName, 0, KEY_READ, &subKey)
11789 +                   == ERROR_SUCCESS) )
11790 +    {
11791 +      DWORD type;
11792 +      char *chtry = NULL;
11793 +      DWORD bufSize = 0;
11794 +      
11795 +      if ( (RegQueryValueExA(subKey, valName, NULL, &type, chtry, &bufSize)
11796 +           == ERROR_SUCCESS) && (type == REG_SZ) )
11797 +        {
11798 +         if ( (chtry = (char *)xmalloc(bufSize))
11799 +              && (RegQueryValueExA(subKey, valName, NULL, &type, chtry, &bufSize) 
11800 +                  == ERROR_SUCCESS) )
11801 +           result = chtry;
11802 +        }
11803 +    }
11804 +  return result;
11806 +#endif /* __MINGW32__  */
11808 Index: readline/signals.c
11809 ===================================================================
11810 RCS file: /prjz/.cvsroot/gdb/readline/signals.c,v
11811 retrieving revision 1.1.1.1
11812 diff -u -3 -p -r1.1.1.1 signals.c
11813 --- readline/signals.c  2003/02/16 21:36:32     1.1.1.1
11814 +++ readline/signals.c  2003/02/17 12:47:10
11815 @@ -61,7 +61,7 @@
11816  #  define SIGHANDLER_RETURN return (0)
11817  #endif
11819 -/* This typedef is equivalant to the one for Function; it allows us
11820 +/* This typedef is equivalent to the one for Function; it allows us
11821     to say SigHandler *foo = signal (SIGKILL, SIG_IGN); */
11822  typedef RETSIGTYPE SigHandler ();
11824 @@ -73,7 +73,9 @@ typedef struct { SigHandler *sa_handler;
11825  #  define sigemptyset(m)
11826  #endif /* !HAVE_POSIX_SIGNALS */
11828 +#ifndef __MINGW32__
11829  static SigHandler *rl_set_sighandler __P((int, SigHandler *, sighandler_cxt *));
11830 +#endif
11832  /* Exported variables for use by applications. */
11834 @@ -87,10 +89,9 @@ int rl_catch_sigwinch = 1;
11835  #endif
11837  static int signals_set_flag;
11838 -#ifdef SIGWINCH
11839  static int sigwinch_set_flag;
11840 -#endif
11842 +#ifndef __MINGW32__
11843  /* **************************************************************** */
11844  /*                                                                 */
11845  /*                        Signal Handling                          */
11846 @@ -121,6 +122,8 @@ rl_signal_handler (sig)
11847  #  endif /* !HAVE_BSD_SIGNALS */
11848  #endif /* !HAVE_POSIX_SIGNALS */
11850 +  RL_SETSTATE(RL_STATE_SIGHANDLER);
11852  #if !defined (HAVE_BSD_SIGNALS) && !defined (HAVE_POSIX_SIGNALS)
11853    /* Since the signal will not be blocked while we are in the signal
11854       handler, ignore it until rl_clear_signals resets the catcher. */
11855 @@ -171,6 +174,7 @@ rl_signal_handler (sig)
11856        rl_reset_after_signal ();
11857      }
11859 +  RL_UNSETSTATE(RL_STATE_SIGHANDLER);
11860    SIGHANDLER_RETURN;
11863 @@ -191,6 +195,7 @@ rl_sigwinch_handler (sig)
11864    rl_set_sighandler (SIGWINCH, rl_sigwinch_handler, &dummy_winch);
11865  #endif
11867 +  RL_SETSTATE(RL_STATE_SIGHANDLER);
11868    rl_resize_terminal ();
11870    /* If another sigwinch handler has been installed, call it. */
11871 @@ -198,6 +203,7 @@ rl_sigwinch_handler (sig)
11872    if (oh &&  oh != (SigHandler *)SIG_IGN && oh != (SigHandler *)SIG_DFL)
11873      (*oh) (sig);
11875 +  RL_UNSETSTATE(RL_STATE_SIGHANDLER);
11876    SIGHANDLER_RETURN;
11878  #endif  /* SIGWINCH */
11879 @@ -351,6 +357,7 @@ rl_clear_signals ()
11881    return 0;
11883 +#endif /* !__MINGW32__ */
11885  /* Clean up the terminal and readline state after catching a signal, before
11886     resending it to the calling application. */
11887 @@ -360,7 +367,7 @@ rl_cleanup_after_signal ()
11888    _rl_clean_up_for_exit ();
11889    (*rl_deprep_term_function) ();
11890    rl_clear_signals ();
11891 -  rl_pending_input = 0;
11892 +  rl_clear_pending_input ();
11895  /* Reset the terminal and readline state after a signal handler returns. */
11896 @@ -380,7 +387,7 @@ rl_free_line_state ()
11898    register HIST_ENTRY *entry;
11900 -  free_undo_list ();
11901 +  rl_free_undo_list ();
11903    entry = current_history ();
11904    if (entry)
11905 @@ -391,4 +398,50 @@ rl_free_line_state ()
11906    _rl_init_argument ();
11909 +#if defined (__MINGW32__)
11911 +#include <windows.h>
11912 +#include <signal.h>
11913 +#include <stdio.h>
11915 +/* Handling of CTRL_C_EVENT, CTRL_CLOSE_EVENT, CTRL_BREAK_EVENT, 
11916 + * CTRL_LOGOFF_EVENT, CTRL_SHUTDOWN_EVENT,
11917 + * WINDOW_BUFFER_SIZE_EVENTs are handled separately see input.c
11918 + */
11920 +BOOL CtrlEventHandler(DWORD dwEventType)
11922 +  if (dwEventType == CTRL_C_EVENT)
11923 +    rl_free_line_state ();
11924 +  rl_cleanup_after_signal ();
11925 +  if (dwEventType == CTRL_C_EVENT)     /* special treatment */
11926 +    {
11927 +      if (rl_catch_signals == 1)       /* > 1: handled only locally */
11928 +       {
11929 +         raise(SIGINT);                /* pass to program signal hadler */
11930 +         rl_reset_after_signal();      /* on return goon */
11931 +       }
11932 +      return TRUE;                     /* don't pass to upstream handlers */
11933 +    }
11934 +  return FALSE;                        /* pass other events to handler chain */
11937 +int
11938 +rl_set_signals ()
11940 +  if (rl_catch_signals && signals_set_flag == 0)
11941 +    signals_set_flag = SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlEventHandler, TRUE);
11942 +  return signals_set_flag;
11945 +int
11946 +rl_clear_signals ()
11948 +  if ( signals_set_flag )
11949 +    if ( SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlEventHandler, FALSE) )
11950 +      signals_set_flag = 0;
11951 +  return signals_set_flag;
11954 +#endif /* __MINGW32__  */
11955  #endif  /* HANDLE_SIGNALS */
11956 Index: readline/terminal.c
11957 ===================================================================
11958 RCS file: /prjz/.cvsroot/gdb/readline/terminal.c,v
11959 retrieving revision 1.1.1.1
11960 diff -u -3 -p -r1.1.1.1 terminal.c
11961 --- readline/terminal.c 2003/02/16 21:36:32     1.1.1.1
11962 +++ readline/terminal.c 2003/02/17 12:47:10
11963 @@ -51,12 +51,16 @@
11964  /* System-specific feature definitions and include files. */
11965  #include "rldefs.h"
11967 +#if defined (__MINGW32__)
11968 +# include <windows.h>
11969 +extern int haveConsole;        /* imported from rltty.c  */
11970 +extern HANDLE hStdout, hStdin;
11971 +extern COORD   rlScreenEnd;
11972 +extern int     rlScreenMax;
11973 +#else /* !__MINGW32__ */
11974  #if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ)
11975  #  include <sys/ioctl.h>
11976  #endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */
11978 -#ifdef __MSDOS__
11979 -# include <pc.h>
11980  #endif
11982  #include "rltty.h"
11983 @@ -75,15 +79,12 @@
11984  /*                                                                 */
11985  /* **************************************************************** */
11987 -#ifndef __MSDOS__
11988 +#ifndef __MINGW32__
11989  static char *term_buffer = (char *)NULL;
11990  static char *term_string_buffer = (char *)NULL;
11992 -/* Non-zero means this terminal can't really do anything. */
11993 -static int dumb_term;
11994 -#endif /* !__MSDOS__ */
11996  static int tcap_initialized;
11997 +#endif
11999  #if !defined (__linux__)
12000  #  if defined (__EMX__) || defined (NEED_EXTERN_PC)
12001 @@ -93,27 +94,36 @@ char PC, *BC, *UP;
12002  #endif /* __linux__ */
12004  /* Some strings to control terminal actions.  These are output by tputs (). */
12005 -char *term_goto, *term_clreol, *term_cr, *term_clrpag, *term_backspace;
12006 -char *term_pc;
12007 +char *_rl_term_clreol;
12008 +char *_rl_term_clrpag;
12009 +char *_rl_term_cr;
12010 +char *_rl_term_backspace;
12011 +char *_rl_term_goto;
12012 +char *_rl_term_pc;
12014  /* Non-zero if we determine that the terminal can do character insertion. */
12015 -int terminal_can_insert = 0;
12016 +int _rl_terminal_can_insert = 0;
12018  /* How to insert characters. */
12019 -char *term_im, *term_ei, *term_ic, *term_ip, *term_IC;
12020 +char *_rl_term_im;
12021 +char *_rl_term_ei;
12022 +char *_rl_term_ic;
12023 +char *_rl_term_ip;
12024 +char *_rl_term_IC;
12026  /* How to delete characters. */
12027 -char *term_dc, *term_DC;
12028 +char *_rl_term_dc;
12029 +char *_rl_term_DC;
12031  #if defined (HACK_TERMCAP_MOTION)
12032 -char *term_forward_char;
12033 +char *_rl_term_forward_char;
12034  #endif  /* HACK_TERMCAP_MOTION */
12036  /* How to go up a line. */
12037 -char *term_up;
12038 +char *_rl_term_up;
12040 -/* A visible bell, if the terminal can be made to flash the screen. */
12041 -static char *visible_bell;
12042 +/* A visible bell; char if the terminal can be made to flash the screen. */
12043 +static char *_rl_visible_bell;
12045  /* Non-zero means the terminal can auto-wrap lines. */
12046  int _rl_term_autowrap;
12047 @@ -122,20 +132,26 @@ int _rl_term_autowrap;
12048  static int term_has_meta;
12050  /* The sequences to write to turn on and off the meta key, if this
12051 -   terminal    has one. */
12052 -static char *term_mm, *term_mo;
12053 +   terminal has one. */
12054 +static char *_rl_term_mm;
12055 +static char *_rl_term_mo;
12057  /* The key sequences output by the arrow keys, if this terminal has any. */
12058 -static char *term_ku, *term_kd, *term_kr, *term_kl;
12059 +static char *_rl_term_ku;
12060 +static char *_rl_term_kd;
12061 +static char *_rl_term_kr;
12062 +static char *_rl_term_kl;
12064  /* How to initialize and reset the arrow keys, if this terminal has any. */
12065 -static char *term_ks, *term_ke;
12066 +static char *_rl_term_ks;
12067 +static char *_rl_term_ke;
12069  /* The key sequences sent by the Home and End keys, if any. */
12070 -static char *term_kh, *term_kH;
12071 +static char *_rl_term_kh;
12072 +static char *_rl_term_kH;
12074  /* Variables that hold the screen dimensions, used by the display code. */
12075 -int screenwidth, screenheight, screenchars;
12076 +int _rl_screenwidth, _rl_screenheight, _rl_screenchars;
12078  /* Non-zero means the user wants to enable the keypad. */
12079  int _rl_enable_keypad;
12080 @@ -163,6 +179,7 @@ _emx_get_screensize (swp, shp)
12081     to the terminal.  If IGNORE_ENV is true, we do not pay attention to the
12082     values of $LINES and $COLUMNS.  The tests for TERM_STRING_BUFFER being
12083     non-null serve to check whether or not we have initialized termcap. */
12084 +#ifndef __MINGW32__
12085  void
12086  _rl_get_screen_size (tty, ignore_env)
12087       int tty, ignore_env;
12088 @@ -175,79 +192,115 @@ _rl_get_screen_size (tty, ignore_env)
12089  #if defined (TIOCGWINSZ)
12090    if (ioctl (tty, TIOCGWINSZ, &window_size) == 0)
12091      {
12092 -      screenwidth = (int) window_size.ws_col;
12093 -      screenheight = (int) window_size.ws_row;
12094 +      _rl_screenwidth = (int) window_size.ws_col;
12095 +      _rl_screenheight = (int) window_size.ws_row;
12096      }
12097  #endif /* TIOCGWINSZ */
12099  #if defined (__EMX__)
12100 -  _emx_get_screensize (&screenwidth, &screenheight);
12101 +  _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
12102  #endif
12104    /* Environment variable COLUMNS overrides setting of "co" if IGNORE_ENV
12105       is unset. */
12106 -  if (screenwidth <= 0)
12107 +  if (_rl_screenwidth <= 0)
12108      {
12109 -      if (ignore_env == 0 && (ss = get_env_value ("COLUMNS")))
12110 -       screenwidth = atoi (ss);
12111 +      if (ignore_env == 0 && (ss = sh_get_env_value ("COLUMNS")))
12112 +       _rl_screenwidth = atoi (ss);
12114 -#if defined (__DJGPP__)
12115 -      if (screenwidth <= 0)
12116 -       screenwidth = ScreenCols ();
12117 -#else
12118 -      if (screenwidth <= 0 && term_string_buffer)
12119 -       screenwidth = tgetnum ("co");
12120 +#if !defined (__DJGPP__)
12121 +      if (_rl_screenwidth <= 0 && term_string_buffer)
12122 +       _rl_screenwidth = tgetnum ("co");
12123  #endif
12124      }
12126    /* Environment variable LINES overrides setting of "li" if IGNORE_ENV
12127       is unset. */
12128 -  if (screenheight <= 0)
12129 +  if (_rl_screenheight <= 0)
12130      {
12131 -      if (ignore_env == 0 && (ss = get_env_value ("LINES")))
12132 -       screenheight = atoi (ss);
12133 +      if (ignore_env == 0 && (ss = sh_get_env_value ("LINES")))
12134 +       _rl_screenheight = atoi (ss);
12136 -#if defined (__DJGPP__)
12137 -      if (screenheight <= 0)
12138 -       screenheight = ScreenRows ();
12139 -#else
12140 -      if (screenheight <= 0 && term_string_buffer)
12141 -       screenheight = tgetnum ("li");
12142 +#if !defined (__DJGPP__)
12143 +      if (_rl_screenheight <= 0 && term_string_buffer)
12144 +       _rl_screenheight = tgetnum ("li");
12145  #endif
12146      }
12148    /* If all else fails, default to 80x24 terminal. */
12149 -  if (screenwidth <= 1)
12150 -    screenwidth = 80;
12151 +  if (_rl_screenwidth <= 1)
12152 +    _rl_screenwidth = 80;
12154 -  if (screenheight <= 0)
12155 -    screenheight = 24;
12156 +  if (_rl_screenheight <= 0)
12157 +    _rl_screenheight = 24;
12159    /* If we're being compiled as part of bash, set the environment
12160       variables $LINES and $COLUMNS to new values.  Otherwise, just
12161       do a pair of putenv () or setenv () calls. */
12162 -  set_lines_and_columns (screenheight, screenwidth);
12163 +  sh_set_lines_and_columns (_rl_screenheight, _rl_screenwidth);
12165    if (_rl_term_autowrap == 0)
12166 -    screenwidth--;
12167 +    _rl_screenwidth--;
12169 -  screenchars = screenwidth * screenheight;
12170 +  _rl_screenchars = _rl_screenwidth * _rl_screenheight;
12173 +#else  /* __MINGW32__*/
12175 +void
12176 +_rl_get_screen_size (tty, ignore_env)
12177 +     int tty, ignore_env;
12179 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
12180 +  
12181 +  if ( (haveConsole & FOR_OUTPUT) && GetConsoleScreenBufferInfo(hStdout, &csbi) )
12182 +    {
12183 +      _rl_screenwidth = csbi.dwSize.X;
12184 +      _rl_screenheight = csbi.dwSize.Y;
12185 +    }
12186 +  else
12187 +    {
12188 +      _rl_screenwidth = 80;
12189 +      _rl_screenheight = 24;
12190 +    }
12191 +  _rl_screenchars = _rl_screenwidth * _rl_screenheight;
12193 +#endif /* __MINGW32__  */
12195  void
12196  _rl_set_screen_size (rows, cols)
12197       int rows, cols;
12199 -  screenheight = rows;
12200 -  screenwidth = cols;
12201 +  if (rows == 0 || cols == 0)
12202 +    return;
12204 +  _rl_screenheight = rows;
12205 +  _rl_screenwidth = cols;
12207    if (_rl_term_autowrap == 0)
12208 -    screenwidth--;
12209 +    _rl_screenwidth--;
12211 -  screenchars = screenwidth * screenheight;
12212 +  _rl_screenchars = _rl_screenwidth * _rl_screenheight;
12215  void
12216 +rl_set_screen_size (rows, cols)
12217 +     int rows, cols;
12219 +  _rl_set_screen_size (rows, cols);
12222 +void
12223 +rl_get_screen_size (rows, cols)
12224 +     int *rows, *cols;
12226 +  if (rows)
12227 +    *rows = _rl_screenheight;
12228 +  if (cols)
12229 +    *cols = _rl_screenwidth;
12231 +     
12232 +void
12233  rl_resize_terminal ()
12235    if (readline_echoing_p)
12236 @@ -257,8 +310,9 @@ rl_resize_terminal ()
12237      }
12240 +#ifndef __MINGW32__
12241  struct _tc_string {
12242 -     char *tc_var;
12243 +     const char *tc_var;
12244       char **tc_value;
12245  };
12247 @@ -266,32 +320,32 @@ struct _tc_string {
12248     search algorithm to something smarter. */
12249  static struct _tc_string tc_strings[] =
12251 -  { "DC", &term_DC },
12252 -  { "IC", &term_IC },
12253 -  { "ce", &term_clreol },
12254 -  { "cl", &term_clrpag },
12255 -  { "cr", &term_cr },
12256 -  { "dc", &term_dc },
12257 -  { "ei", &term_ei },
12258 -  { "ic", &term_ic },
12259 -  { "im", &term_im },
12260 -  { "kd", &term_kd },
12261 -  { "kh", &term_kh },  /* home */
12262 -  { "kH", &term_kH },  /* end */
12263 -  { "kl", &term_kl },
12264 -  { "kr", &term_kr },
12265 -  { "ku", &term_ku },
12266 -  { "ks", &term_ks },
12267 -  { "ke", &term_ke },
12268 -  { "le", &term_backspace },
12269 -  { "mm", &term_mm },
12270 -  { "mo", &term_mo },
12271 +  { "DC", &_rl_term_DC },
12272 +  { "IC", &_rl_term_IC },
12273 +  { "ce", &_rl_term_clreol },
12274 +  { "cl", &_rl_term_clrpag },
12275 +  { "cr", &_rl_term_cr },
12276 +  { "dc", &_rl_term_dc },
12277 +  { "ei", &_rl_term_ei },
12278 +  { "ic", &_rl_term_ic },
12279 +  { "im", &_rl_term_im },
12280 +  { "kd", &_rl_term_kd },
12281 +  { "kh", &_rl_term_kh },      /* home */
12282 +  { "kH", &_rl_term_kH },      /* end */
12283 +  { "kl", &_rl_term_kl },
12284 +  { "kr", &_rl_term_kr },
12285 +  { "ku", &_rl_term_ku },
12286 +  { "ks", &_rl_term_ks },
12287 +  { "ke", &_rl_term_ke },
12288 +  { "le", &_rl_term_backspace },
12289 +  { "mm", &_rl_term_mm },
12290 +  { "mo", &_rl_term_mo },
12291  #if defined (HACK_TERMCAP_MOTION)
12292 -  { "nd", &term_forward_char },
12293 +  { "nd", &_rl_term_forward_char },
12294  #endif
12295 -  { "pc", &term_pc },
12296 -  { "up", &term_up },
12297 -  { "vb", &visible_bell },
12298 +  { "pc", &_rl_term_pc },
12299 +  { "up", &_rl_term_up },
12300 +  { "vb", &_rl_visible_bell },
12301  };
12303  #define NUM_TC_STRINGS (sizeof (tc_strings) / sizeof (struct _tc_string))
12304 @@ -310,36 +364,53 @@ get_term_capabilities (bp)
12305  #endif
12306    tcap_initialized = 1;
12308 +#endif /* __MINGW32__ */
12310  #define CUSTOM_REDISPLAY_FUNC() (rl_redisplay_function != rl_redisplay)
12311  #define CUSTOM_INPUT_FUNC() (rl_getc_function != rl_getc)
12313  int
12314  _rl_init_terminal_io (terminal_name)
12315 -     char *terminal_name;
12316 +     const char *terminal_name;
12318 -  char *term, *buffer;
12319 +#ifdef __MINGW32__
12320 +  _rl_term_cr = "\r";                                          /* any value != 0  */
12321 +  _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;        /* !! we emulate insertion  */
12322 +  _rl_term_up = "y";                                           /* any value != 0  */
12323 +  _rl_term_dc = _rl_term_DC =  (char *)NULL;                   /* !! we emulate deletion  */
12324 +  _rl_visible_bell = (char *)NULL;
12326 +  _rl_get_screen_size (0, 1);
12327 +   
12328 +  /* Let Windows handle meta keys!  */
12329 +  term_has_meta = 0;
12330 +  _rl_term_mm = _rl_term_mo = (char *)NULL;
12332 +  /* It probably has arrow keys, but I don't know what they are. */
12333 +  _rl_term_ku = _rl_term_kd = _rl_term_kr = _rl_term_kl = (char *)NULL;
12334 +  
12335 +#if defined (HACK_TERMCAP_MOTION)
12336 +  _rl_term_forward_char = (char *)NULL;
12337 +#endif /* HACK_TERMCAP_MOTION */
12339 +  _rl_terminal_can_insert = 0;
12340 +  _rl_term_autowrap = 1;
12342 +#else /* !__MINGW32__ */
12344 +  const char *term;
12345 +  char *buffer;
12346    int tty, tgetent_ret;
12347    Keymap xkeymap;
12349 -  term = terminal_name ? terminal_name : get_env_value ("TERM");
12350 -  term_clrpag = term_cr = term_clreol = (char *)NULL;
12351 +  term = terminal_name ? terminal_name : sh_get_env_value ("TERM");
12352 +  _rl_term_clrpag = _rl_term_cr = _rl_term_clreol = (char *)NULL;
12353    tty = rl_instream ? fileno (rl_instream) : 0;
12354 -  screenwidth = screenheight = 0;
12355 +  _rl_screenwidth = _rl_screenheight = 0;
12357    if (term == 0)
12358      term = "dumb";
12360 -#ifdef __MSDOS__
12361 -  term_im = term_ei = term_ic = term_IC = (char *)NULL;
12362 -  term_up = term_dc = term_DC = visible_bell = (char *)NULL;
12363 -  term_ku = term_kd = term_kl = term_kr = (char *)NULL;
12364 -  term_mm = term_mo = (char *)NULL;
12365 -  terminal_can_insert = term_has_meta = _rl_term_autowrap = 0;
12366 -  term_cr = "\r";
12368 -  _rl_get_screen_size (tty, 0);
12369 -#else  /* !__MSDOS__ */
12370    /* I've separated this out for later work on not calling tgetent at all
12371       if the calling application has supplied a custom redisplay function,
12372       (and possibly if the application has supplied a custom input function). */
12373 @@ -366,41 +437,40 @@ _rl_init_terminal_io (terminal_name)
12374        FREE (term_buffer);
12375        buffer = term_buffer = term_string_buffer = (char *)NULL;
12377 -      dumb_term = 1;
12378        _rl_term_autowrap = 0;   /* used by _rl_get_screen_size */
12380  #if defined (__EMX__)
12381 -      _emx_get_screensize (&screenwidth, &screenheight);
12382 -      screenwidth--;
12383 +      _emx_get_screensize (&_rl_screenwidth, &_rl_screenheight);
12384 +      _rl_screenwidth--;
12385  #else /* !__EMX__ */
12386        _rl_get_screen_size (tty, 0);
12387  #endif /* !__EMX__ */
12389        /* Defaults. */
12390 -      if (screenwidth <= 0 || screenheight <= 0)
12391 +      if (_rl_screenwidth <= 0 || _rl_screenheight <= 0)
12392          {
12393 -         screenwidth = 79;
12394 -         screenheight = 24;
12395 +         _rl_screenwidth = 79;
12396 +         _rl_screenheight = 24;
12397          }
12399        /* Everything below here is used by the redisplay code (tputs). */
12400 -      screenchars = screenwidth * screenheight;
12401 -      term_cr = "\r";
12402 -      term_im = term_ei = term_ic = term_IC = (char *)NULL;
12403 -      term_up = term_dc = term_DC = visible_bell = (char *)NULL;
12404 -      term_ku = term_kd = term_kl = term_kr = (char *)NULL;
12405 -      term_mm = term_mo = (char *)NULL;
12406 +      _rl_screenchars = _rl_screenwidth * _rl_screenheight;
12407 +      _rl_term_cr = "\r";
12408 +      _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
12409 +      _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
12410 +      _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
12411 +      _rl_term_mm = _rl_term_mo = (char *)NULL;
12412  #if defined (HACK_TERMCAP_MOTION)
12413 -      term_forward_char = (char *)NULL;
12414 +      _rl_term_forward_char = (char *)NULL;
12415  #endif
12416 -      terminal_can_insert = term_has_meta = 0;
12417 +      _rl_terminal_can_insert = term_has_meta = 0;
12419        /* Reasonable defaults for tgoto().  Readline currently only uses
12420 -         tgoto if term_IC or term_DC is defined, but just in case we
12421 +         tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
12422           change that later... */
12423        PC = '\0';
12424 -      BC = term_backspace = "\b";
12425 -      UP = term_up;
12426 +      BC = _rl_term_backspace = "\b";
12427 +      UP = _rl_term_up;
12429        return 0;
12430      }
12431 @@ -409,12 +479,12 @@ _rl_init_terminal_io (terminal_name)
12433    /* Set up the variables that the termcap library expects the application
12434       to provide. */
12435 -  PC = term_pc ? *term_pc : 0;
12436 -  BC = term_backspace;
12437 -  UP = term_up;
12438 +  PC = _rl_term_pc ? *_rl_term_pc : 0;
12439 +  BC = _rl_term_backspace;
12440 +  UP = _rl_term_up;
12442 -  if (!term_cr)
12443 -    term_cr = "\r";
12444 +  if (!_rl_term_cr)
12445 +    _rl_term_cr = "\r";
12447    _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
12449 @@ -424,48 +494,48 @@ _rl_init_terminal_io (terminal_name)
12450        character insertion if *any one of* the capabilities `IC',
12451        `im', `ic' or `ip' is provided."  But we can't do anything if
12452        only `ip' is provided, so... */
12453 -  terminal_can_insert = (term_IC || term_im || term_ic);
12454 +  _rl_terminal_can_insert = (_rl_term_IC || _rl_term_im || _rl_term_ic);
12456    /* Check to see if this terminal has a meta key and clear the capability
12457       variables if there is none. */
12458    term_has_meta = (tgetflag ("km") || tgetflag ("MT"));
12459    if (!term_has_meta)
12460 -    term_mm = term_mo = (char *)NULL;
12461 +    _rl_term_mm = _rl_term_mo = (char *)NULL;
12463 -#endif /* !__MSDOS__ */
12465    /* Attempt to find and bind the arrow keys.  Do not override already
12466       bound keys in an overzealous attempt, however. */
12467    xkeymap = _rl_keymap;
12469    _rl_keymap = emacs_standard_keymap;
12470 -  _rl_bind_if_unbound (term_ku, rl_get_previous_history);
12471 -  _rl_bind_if_unbound (term_kd, rl_get_next_history);
12472 -  _rl_bind_if_unbound (term_kr, rl_forward);
12473 -  _rl_bind_if_unbound (term_kl, rl_backward);
12474 +  _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
12475 +  _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
12476 +  _rl_bind_if_unbound (_rl_term_kr, rl_forward);
12477 +  _rl_bind_if_unbound (_rl_term_kl, rl_backward);
12479 -  _rl_bind_if_unbound (term_kh, rl_beg_of_line);       /* Home */
12480 -  _rl_bind_if_unbound (term_kH, rl_end_of_line);       /* End */
12481 +  _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line);   /* Home */
12482 +  _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line);   /* End */
12484  #if defined (VI_MODE)
12485    _rl_keymap = vi_movement_keymap;
12486 -  _rl_bind_if_unbound (term_ku, rl_get_previous_history);
12487 -  _rl_bind_if_unbound (term_kd, rl_get_next_history);
12488 -  _rl_bind_if_unbound (term_kr, rl_forward);
12489 -  _rl_bind_if_unbound (term_kl, rl_backward);
12490 +  _rl_bind_if_unbound (_rl_term_ku, rl_get_previous_history);
12491 +  _rl_bind_if_unbound (_rl_term_kd, rl_get_next_history);
12492 +  _rl_bind_if_unbound (_rl_term_kr, rl_forward);
12493 +  _rl_bind_if_unbound (_rl_term_kl, rl_backward);
12495 -  _rl_bind_if_unbound (term_kh, rl_beg_of_line);       /* Home */
12496 -  _rl_bind_if_unbound (term_kH, rl_end_of_line);       /* End */
12497 +  _rl_bind_if_unbound (_rl_term_kh, rl_beg_of_line);   /* Home */
12498 +  _rl_bind_if_unbound (_rl_term_kH, rl_end_of_line);   /* End */
12499  #endif /* VI_MODE */
12501    _rl_keymap = xkeymap;
12503 +#endif /* !__MINGW32__ */
12504    return 0;
12507 +#ifndef __MINGW32__
12508  char *
12509  rl_get_termcap (cap)
12510 -     char *cap;
12511 +     const char *cap;
12513    register int i;
12515 @@ -478,17 +548,19 @@ rl_get_termcap (cap)
12516      }
12517    return ((char *)NULL);
12519 +#endif
12521  /* Re-initialize the terminal considering that the TERM/TERMCAP variable
12522     has changed. */
12523  int
12524  rl_reset_terminal (terminal_name)
12525 -     char *terminal_name;
12526 +     const char *terminal_name;
12528    _rl_init_terminal_io (terminal_name);
12529    return 0;
12532 +#ifndef __MINGW32__
12533  /* A function for the use of tputs () */
12534  #ifdef _MINIX
12535  void
12536 @@ -509,7 +581,7 @@ _rl_output_character_function (c)
12537  /* Write COUNT characters from STRING to the output stream. */
12538  void
12539  _rl_output_some_chars (string, count)
12540 -     char *string;
12541 +     const char *string;
12542       int count;
12544    fwrite (string, 1, count, _rl_out_stream);
12545 @@ -522,12 +594,10 @@ _rl_backspace (count)
12547    register int i;
12549 -#ifndef __MSDOS__
12550 -  if (term_backspace)
12551 +  if (_rl_term_backspace)
12552      for (i = 0; i < count; i++)
12553 -      tputs (term_backspace, 1, _rl_output_character_function);
12554 +      tputs (_rl_term_backspace, 1, _rl_output_character_function);
12555    else
12556 -#endif
12557      for (i = 0; i < count; i++)
12558        putc ('\b', _rl_out_stream);
12559    return 0;
12560 @@ -535,11 +605,11 @@ _rl_backspace (count)
12562  /* Move to the start of the next line. */
12563  int
12564 -crlf ()
12565 +rl_crlf ()
12567  #if defined (NEW_TTY_DRIVER)
12568 -  if (term_cr)
12569 -    tputs (term_cr, 1, _rl_output_character_function);
12570 +  if (_rl_term_cr)
12571 +    tputs (_rl_term_cr, 1, _rl_output_character_function);
12572  #endif /* NEW_TTY_DRIVER */
12573    putc ('\n', _rl_out_stream);
12574    return 0;
12575 @@ -547,7 +617,7 @@ crlf ()
12577  /* Ring the terminal bell. */
12578  int
12579 -ding ()
12580 +rl_ding ()
12582    if (readline_echoing_p)
12583      {
12584 @@ -557,16 +627,11 @@ ding ()
12585         default:
12586           break;
12587         case VISIBLE_BELL:
12588 -#ifdef __MSDOS__
12589 -         ScreenVisualBell ();
12590 -         break;
12591 -#else
12592 -         if (visible_bell)
12593 +         if (_rl_visible_bell)
12594             {
12595 -             tputs (visible_bell, 1, _rl_output_character_function);
12596 +             tputs (_rl_visible_bell, 1, _rl_output_character_function);
12597               break;
12598             }
12599 -#endif
12600           /* FALLTHROUGH */
12601         case AUDIBLE_BELL:
12602           fprintf (stderr, "\007");
12603 @@ -578,6 +643,80 @@ ding ()
12604    return (-1);
12607 +#else  /* __MINGW32__ */
12609 +/* Write COUNT characters from STRING to the output stream. */
12610 +void
12611 +_rl_output_some_chars (string, count)
12612 +     const char *string;
12613 +     int count;
12615 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
12616 +  fwrite (string, 1, count, _rl_out_stream);
12617 +  if ( (haveConsole & FOR_OUTPUT) && GetConsoleScreenBufferInfo(hStdout, &csbi) )
12618 +    {
12619 +      int linear_pos = (int)csbi.dwCursorPosition.Y * (int)csbi.dwSize.X
12620 +                       + (int)csbi.dwCursorPosition.X;
12621 +      if (linear_pos > rlScreenMax)
12622 +        {
12623 +          rlScreenEnd = csbi.dwCursorPosition;
12624 +          rlScreenMax = linear_pos;
12625 +        }
12626 +    }
12629 +/* This is used to collect all putc output */
12630 +int
12631 +_rl_output_character_function (c)
12632 +     int c;
12634 +  _rl_output_some_chars ((char *)&c, 1);
12635 +  return 1;
12638 +/* Move the cursor back. */
12639 +int
12640 +_rl_backspace (count)
12641 +     int count;
12643 +  CONSOLE_SCREEN_BUFFER_INFO   csbi;
12645 +  if ( (haveConsole & FOR_OUTPUT) && GetConsoleScreenBufferInfo(hStdout, &csbi) )
12646 +    {
12647 +      while (count > csbi.dwCursorPosition.X)
12648 +        {
12649 +          --csbi.dwCursorPosition.Y;
12650 +          count -= csbi.dwCursorPosition.X + 1;
12651 +          csbi.dwCursorPosition.X = csbi.dwSize.X - 1;
12652 +        }
12653 +      csbi.dwCursorPosition.X -= count;
12654 +      SetConsoleCursorPosition(hStdout, csbi.dwCursorPosition);
12655 +    }
12656 +  return 0;
12659 +/* Move to the start of the next line. */
12660 +int
12661 +rl_crlf ()
12663 +  _rl_output_some_chars ("\n", 1);
12664 +  return 0;
12667 +/* Ring the terminal bell. */
12668 +int
12669 +rl_ding ()
12671 +  if (readline_echoing_p)
12672 +    {
12673 +      if (_rl_bell_preference != NO_BELL)
12674 +       MessageBeep(MB_OK);
12675 +      return (0);
12676 +    }
12677 +  return (-1);
12679 +#endif /* __MINGW32__ */
12681  /* **************************************************************** */
12682  /*                                                                 */
12683  /*             Controlling the Meta Key and Keypad                 */
12684 @@ -587,9 +726,9 @@ ding ()
12685  void
12686  _rl_enable_meta_key ()
12688 -#if !defined (__DJGPP__)
12689 -  if (term_has_meta && term_mm)
12690 -    tputs (term_mm, 1, _rl_output_character_function);
12691 +#if !defined (__DJGPP__) && !defined (__MINGW32__)
12692 +  if (term_has_meta && _rl_term_mm)
12693 +    tputs (_rl_term_mm, 1, _rl_output_character_function);
12694  #endif
12697 @@ -597,10 +736,10 @@ void
12698  _rl_control_keypad (on)
12699       int on;
12701 -#if !defined (__DJGPP__)
12702 -  if (on && term_ks)
12703 -    tputs (term_ks, 1, _rl_output_character_function);
12704 -  else if (!on && term_ke)
12705 -    tputs (term_ke, 1, _rl_output_character_function);
12706 +#if !defined (__DJGPP__) && !defined (__MINGW32__)
12707 +  if (on && _rl_term_ks)
12708 +    tputs (_rl_term_ks, 1, _rl_output_character_function);
12709 +  else if (!on && _rl_term_ke)
12710 +    tputs (_rl_term_ke, 1, _rl_output_character_function);
12711  #endif
12713 Index: readline/tilde.c
12714 ===================================================================
12715 RCS file: /prjz/.cvsroot/gdb/readline/tilde.c,v
12716 retrieving revision 1.1.1.1
12717 diff -u -3 -p -r1.1.1.1 tilde.c
12718 --- readline/tilde.c    2003/02/16 21:36:32     1.1.1.1
12719 +++ readline/tilde.c    2003/02/17 12:47:10
12720 @@ -43,23 +43,24 @@
12721  #endif /* HAVE_STDLIB_H */
12723  #include <sys/types.h>
12724 +#ifndef __MINGW32__
12725  #include <pwd.h>
12726 +#else
12727 +#include <windows.h>
12728 +#endif
12730  #include "tilde.h"
12732  #if defined (TEST) || defined (STATIC_MALLOC)
12733  static char *xmalloc (), *xrealloc ();
12734  #else
12735 -#  if defined __STDC__
12736 -extern char *xmalloc (int);
12737 -extern char *xrealloc (void *, int);
12738 -#  else
12739 -extern char *xmalloc (), *xrealloc ();
12740 -#  endif /* !__STDC__ */
12741 +extern char *xmalloc __P((int));
12742 +extern char *xrealloc __P((void *, int));
12743  #endif /* TEST || STATIC_MALLOC */
12745  #if !defined (HAVE_GETPW_DECLS)
12746 -extern struct passwd *getpwuid (), *getpwnam ();
12747 +extern struct passwd *getpwuid __P((uid_t));
12748 +extern struct passwd *getpwnam __P((const char *));
12749  #endif /* !HAVE_GETPW_DECLS */
12751  #if !defined (savestring)
12752 @@ -80,42 +81,42 @@ extern char *strcpy ();
12753  /* If being compiled as part of bash, these will be satisfied from
12754     variables.o.  If being compiled as part of readline, they will
12755     be satisfied from shell.o. */
12756 -extern char *get_home_dir __P((void));
12757 -extern char *get_env_value __P((char *));
12758 +extern char *sh_get_home_dir __P((void));
12759 +extern char *sh_get_env_value __P((const char *));
12761  /* The default value of tilde_additional_prefixes.  This is set to
12762     whitespace preceding a tilde so that simple programs which do not
12763     perform any word separation get desired behaviour. */
12764 -static char *default_prefixes[] =
12765 -  { " ~", "\t~", (char *)NULL };
12766 +static const char *default_prefixes[] =
12767 +  { " ~", "\t~", (const char *)NULL };
12769  /* The default value of tilde_additional_suffixes.  This is set to
12770     whitespace or newline so that simple programs which do not
12771     perform any word separation get desired behaviour. */
12772 -static char *default_suffixes[] =
12773 -  { " ", "\n", (char *)NULL };
12774 +static const char *default_suffixes[] =
12775 +  { " ", "\n", (const char *)NULL };
12777  /* If non-null, this contains the address of a function that the application
12778     wants called before trying the standard tilde expansions.  The function
12779     is called with the text sans tilde, and returns a malloc()'ed string
12780     which is the expansion, or a NULL pointer if the expansion fails. */
12781 -CPFunction *tilde_expansion_preexpansion_hook = (CPFunction *)NULL;
12782 +tilde_hook_func_t *tilde_expansion_preexpansion_hook = (tilde_hook_func_t *)NULL;
12784  /* If non-null, this contains the address of a function to call if the
12785     standard meaning for expanding a tilde fails.  The function is called
12786     with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
12787     which is the expansion, or a NULL pointer if there is no expansion. */
12788 -CPFunction *tilde_expansion_failure_hook = (CPFunction *)NULL;
12789 +tilde_hook_func_t *tilde_expansion_failure_hook = (tilde_hook_func_t *)NULL;
12791  /* When non-null, this is a NULL terminated array of strings which
12792     are duplicates for a tilde prefix.  Bash uses this to expand
12793     `=~' and `:~'. */
12794 -char **tilde_additional_prefixes = default_prefixes;
12795 +char **tilde_additional_prefixes = (char **)default_prefixes;
12797  /* When non-null, this is a NULL terminated array of strings which match
12798     the end of a username, instead of just "/".  Bash sets this to
12799     `:' and `=~'. */
12800 -char **tilde_additional_suffixes = default_suffixes;
12801 +char **tilde_additional_suffixes = (char **)default_suffixes;
12803  /* Find the start of a tilde expansion in STRING, and return the index of
12804     the tilde which starts the expansion.  Place the length of the text
12805 @@ -186,7 +187,7 @@ tilde_find_suffix (string)
12806  /* Return a new string which is the result of tilde expanding STRING. */
12807  char *
12808  tilde_expand (string)
12809 -     char *string;
12810 +     const char *string;
12812    char *result;
12813    int result_size, result_index;
12814 @@ -235,9 +236,9 @@ tilde_expand (string)
12815        free (tilde_word);
12817        len = strlen (expansion);
12818 -#ifdef __CYGWIN32__
12819 +#ifdef __CYGWIN__
12820        /* Fix for Cygwin to prevent ~user/xxx from expanding to //xxx when
12821 -         $HOME for `user' is /.  On cygwin, // denotes a network drive. */
12822 +        $HOME for `user' is /.  On cygwin, // denotes a network drive. */
12823        if (len > 1 || *expansion != '/' || *string != '/')
12824  #endif
12825         {
12826 @@ -303,11 +304,16 @@ glue_prefix_and_suffix (prefix, suffix, 
12827     This always returns a newly-allocated string, never static storage. */
12828  char *
12829  tilde_expand_word (filename)
12830 -     char *filename;
12831 +     const char *filename;
12833    char *dirname, *expansion, *username;
12834    int user_len;
12835 +#ifndef __MINGW32__
12836    struct passwd *user_entry;
12837 +#else
12838 +  char UserName[256];
12839 +  unsigned long UserLen = 256;
12840 +#endif
12842    if (filename == 0)
12843      return ((char *)NULL);
12844 @@ -321,12 +327,12 @@ tilde_expand_word (filename)
12845    if (filename[1] == '\0' || filename[1] == '/')
12846      {
12847        /* Prefix $HOME to the rest of the string. */
12848 -      expansion = get_env_value ("HOME");
12849 +      expansion = sh_get_env_value ("HOME");
12851        /* If there is no HOME variable, look up the directory in
12852          the password database. */
12853        if (expansion == 0)
12854 -       expansion = get_home_dir ();
12855 +       expansion = sh_get_home_dir ();
12857        return (glue_prefix_and_suffix (expansion, filename, 1));
12858      }
12859 @@ -348,6 +354,7 @@ tilde_expand_word (filename)
12860    /* No preexpansion hook, or the preexpansion hook failed.  Look in the
12861       password database. */
12862    dirname = (char *)NULL;
12863 +#ifndef __MINGW32__
12864    user_entry = getpwnam (username);
12865    if (user_entry == 0)
12866      {
12867 @@ -375,6 +382,16 @@ tilde_expand_word (filename)
12868      }
12870    endpwent ();
12871 +#else /* __MINGW32__ */
12872 +  if (GetUserName (UserName, &UserLen))
12873 +    {
12874 +      if (!stricmp (username, UserName))
12875 +       dirname = glue_prefix_and_suffix (sh_get_home_dir (), filename, user_len);
12876 +      else if (dirname == 0)
12877 +       dirname = savestring (filename);
12878 +    }
12879 +  free (username);
12880 +#endif
12881    return (dirname);
12884 Index: readline/tilde.h
12885 ===================================================================
12886 RCS file: /prjz/.cvsroot/gdb/readline/tilde.h,v
12887 retrieving revision 1.1.1.1
12888 diff -u -3 -p -r1.1.1.1 tilde.h
12889 --- readline/tilde.h    2003/02/16 21:36:32     1.1.1.1
12890 +++ readline/tilde.h    2003/02/17 12:47:10
12891 @@ -28,6 +28,14 @@
12892  extern "C" {
12893  #endif
12895 +#if __READLINE_EXPORT__
12896 +# define READLINE_API __declspec (dllexport)
12897 +#elif __READLINE_IMPORT__
12898 +# define READLINE_API __declspec (dllimport)
12899 +#else
12900 +# define READLINE_API
12901 +#endif
12903  /* A function can be defined using prototypes and compile on both ANSI C
12904     and traditional C compilers with something like this:
12905         extern char *func __P((char *, char *, int)); */
12906 @@ -39,44 +47,49 @@ extern "C" {
12907  #    define __P(protos) ()
12908  #  endif
12909  #endif
12911 +#if !defined (__STDC__) && !defined (__cplusplus)
12912 +#  if defined (__GNUC__)       /* gcc with -traditional */
12913 +#    if !defined (const)
12914 +#      define const __const
12915 +#    endif /* !const */
12916 +#  else /* !__GNUC__ */
12917 +#    if !defined (const)
12918 +#      define const
12919 +#    endif /* !const */
12920 +#  endif /* !__GNUC__ */
12921 +#endif /* !__STDC__ && !__cplusplus */
12923 -/* Function pointers can be declared as (Function *)foo. */
12924 -#if !defined (_FUNCTION_DEF)
12925 -#  define _FUNCTION_DEF
12926 -typedef int Function ();
12927 -typedef void VFunction ();
12928 -typedef char *CPFunction ();
12929 -typedef char **CPPFunction ();
12930 -#endif /* _FUNCTION_DEF */
12931 +typedef char *tilde_hook_func_t __P((char *));
12933  /* If non-null, this contains the address of a function that the application
12934     wants called before trying the standard tilde expansions.  The function
12935     is called with the text sans tilde, and returns a malloc()'ed string
12936     which is the expansion, or a NULL pointer if the expansion fails. */
12937 -extern CPFunction *tilde_expansion_preexpansion_hook;
12938 +READLINE_API extern tilde_hook_func_t *tilde_expansion_preexpansion_hook;
12940  /* If non-null, this contains the address of a function to call if the
12941     standard meaning for expanding a tilde fails.  The function is called
12942     with the text (sans tilde, as in "foo"), and returns a malloc()'ed string
12943     which is the expansion, or a NULL pointer if there is no expansion. */
12944 -extern CPFunction *tilde_expansion_failure_hook;
12945 +READLINE_API extern tilde_hook_func_t *tilde_expansion_failure_hook;
12947  /* When non-null, this is a NULL terminated array of strings which
12948     are duplicates for a tilde prefix.  Bash uses this to expand
12949     `=~' and `:~'. */
12950 -extern char **tilde_additional_prefixes;
12951 +READLINE_API extern char **tilde_additional_prefixes;
12953  /* When non-null, this is a NULL terminated array of strings which match
12954     the end of a username, instead of just "/".  Bash sets this to
12955     `:' and `=~'. */
12956 -extern char **tilde_additional_suffixes;
12957 +READLINE_API extern char **tilde_additional_suffixes;
12959  /* Return a new string which is the result of tilde expanding STRING. */
12960 -extern char *tilde_expand __P((char *));
12961 +READLINE_API extern char *tilde_expand __P((const char *));
12963  /* Do the work of tilde expansion on FILENAME.  FILENAME starts with a
12964     tilde.  If there is no expansion, call tilde_expansion_failure_hook. */
12965 -extern char *tilde_expand_word __P((char *));
12966 +READLINE_API extern char *tilde_expand_word __P((const char *));
12968  #ifdef __cplusplus
12970 Index: readline/undo.c
12971 ===================================================================
12972 RCS file: /prjz/.cvsroot/gdb/readline/undo.c,v
12973 retrieving revision 1.1.1.1
12974 diff -u -3 -p -r1.1.1.1 undo.c
12975 --- readline/undo.c     2003/02/16 21:36:32     1.1.1.1
12976 +++ readline/undo.c     2001/02/06 19:14:45
12977 @@ -86,7 +86,7 @@ rl_add_undo (what, start, end, text)
12979  /* Free the existing undo list. */
12980  void
12981 -free_undo_list ()
12982 +rl_free_undo_list ()
12984    while (rl_undo_list)
12985      {
12986 @@ -107,17 +107,18 @@ int
12987  rl_do_undo ()
12989    UNDO_LIST *release;
12990 -  int waiting_for_begin = 0;
12991 -  int start, end;
12992 +  int waiting_for_begin, start, end;
12994  #define TRANS(i) ((i) == -1 ? rl_point : ((i) == -2 ? rl_end : (i)))
12996 +  start = end = waiting_for_begin = 0;
12997    do
12998      {
12999        if (!rl_undo_list)
13000         return (0);
13002        _rl_doing_an_undo = 1;
13003 +      RL_SETSTATE(RL_STATE_UNDOING);
13005        /* To better support vi-mode, a start or end value of -1 means
13006          rl_point, and a value of -2 means rl_end. */
13007 @@ -152,11 +153,12 @@ rl_do_undo ()
13008           if (waiting_for_begin)
13009             waiting_for_begin--;
13010           else
13011 -           ding ();
13012 +           rl_ding ();
13013           break;
13014         }
13016        _rl_doing_an_undo = 0;
13017 +      RL_UNSETSTATE(RL_STATE_UNDOING);
13019        release = rl_undo_list;
13020        rl_undo_list = rl_undo_list->next;
13021 @@ -231,7 +233,7 @@ rl_revert_line (count, key)
13022       int count, key;
13024    if (!rl_undo_list)
13025 -    ding ();
13026 +    rl_ding ();
13027    else
13028      {
13029        while (rl_undo_list)
13030 @@ -254,7 +256,7 @@ rl_undo_command (count, key)
13031         count--;
13032        else
13033         {
13034 -         ding ();
13035 +         rl_ding ();
13036           break;
13037         }
13038      }
13039 Index: readline/util.c
13040 ===================================================================
13041 RCS file: /prjz/.cvsroot/gdb/readline/util.c,v
13042 retrieving revision 1.1.1.1
13043 diff -u -3 -p -r1.1.1.1 util.c
13044 --- readline/util.c     2003/02/16 21:36:32     1.1.1.1
13045 +++ readline/util.c     2003/02/17 12:47:10
13046 @@ -67,10 +67,10 @@
13047     in words, or 1 if it is. */
13049  int _rl_allow_pathname_alphabetic_chars = 0;
13050 -static char *pathname_alphabetic_chars = "/-_=~.#$";
13051 +static const char *pathname_alphabetic_chars = "/-_=~.#$";
13053  int
13054 -alphabetic (c)
13055 +rl_alphabetic (c)
13056       int c;
13058    if (ALPHABETIC (c))
13059 @@ -84,16 +84,16 @@ alphabetic (c)
13060  int
13061  _rl_abort_internal ()
13063 -  ding ();
13064 +  rl_ding ();
13065    rl_clear_message ();
13066    _rl_init_argument ();
13067 -  rl_pending_input = 0;
13068 +  rl_clear_pending_input ();
13070    _rl_defining_kbd_macro = 0;
13071 -  while (_rl_executing_macro)
13072 +  while (rl_executing_macro)
13073      _rl_pop_executing_macro ();
13075 -  rl_last_func = (Function *)NULL;
13076 +  rl_last_func = (rl_command_func_t *)NULL;
13077    longjmp (readline_top_level, 1);
13078    return (0);
13080 @@ -113,7 +113,7 @@ rl_tty_status (count, key)
13081    ioctl (1, TIOCSTAT, (char *)0);
13082    rl_refresh_line (count, key);
13083  #else
13084 -  ding ();
13085 +  rl_ding ();
13086  #endif
13087    return 0;
13089 @@ -215,17 +215,36 @@ rl_tilde_expand (ignore, key)
13090     match in s1.  The compare is case insensitive. */
13091  char *
13092  _rl_strindex (s1, s2)
13093 -     register char *s1, *s2;
13094 +     register const char *s1, *s2;
13096    register int i, l, len;
13098    for (i = 0, l = strlen (s2), len = strlen (s1); (len - i) >= l; i++)
13099      if (_rl_strnicmp (s1 + i, s2, l) == 0)
13100 -      return (s1 + i);
13101 +      return ((char *) (s1 + i));
13102    return ((char *)NULL);
13105 -#if !defined (HAVE_STRCASECMP)
13106 +/* Find the first occurrence in STRING1 of any character from STRING2.
13107 +   Return a pointer to the character in STRING1. */
13108 +char *
13109 +_rl_strpbrk (string1, string2)
13110 +     const char *string1, *string2;
13112 +  register const char *scan;
13114 +  for (; *string1; string1++)
13115 +    {
13116 +      for (scan = string2; *scan; scan++)
13117 +       {
13118 +         if (*string1 == *scan)
13119 +           return ((char *)string1);
13120 +       }
13121 +    }
13122 +  return ((char *)NULL);
13125 +#if !defined (HAVE_STRCASECMP) && !defined (__MINGW32__)
13126  /* Compare at most COUNT characters from string1 to string2.  Case
13127     doesn't matter. */
13128  int
13129 @@ -345,7 +364,7 @@ _rl_digit_value (c)
13130  #undef _rl_savestring
13131  char *
13132  _rl_savestring (s)
13133 -     char *s;
13134 +     const char *s;
13136 -  return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
13137 +  return (strcpy (xmalloc (1 + (int)strlen (s)), (s)));
13139 Index: readline/vi_keymap.c
13140 ===================================================================
13141 RCS file: /prjz/.cvsroot/gdb/readline/vi_keymap.c,v
13142 retrieving revision 1.1.1.1
13143 diff -u -3 -p -r1.1.1.1 vi_keymap.c
13144 --- readline/vi_keymap.c        2003/02/16 21:36:32     1.1.1.1
13145 +++ readline/vi_keymap.c        2000/10/30 16:55:52
13146 @@ -33,429 +33,429 @@ extern KEYMAP_ENTRY_ARRAY vi_escape_keym
13147  /* The keymap arrays for handling vi mode. */
13148  KEYMAP_ENTRY_ARRAY vi_movement_keymap = {
13149    /* The regular control keys come first. */
13150 -  { ISFUNC, (Function *)0x0 },         /* Control-@ */
13151 -  { ISFUNC, (Function *)0x0 },         /* Control-a */
13152 -  { ISFUNC, (Function *)0x0 },         /* Control-b */
13153 -  { ISFUNC, (Function *)0x0 },         /* Control-c */
13154 -  { ISFUNC, rl_vi_eof_maybe },         /* Control-d */
13155 -  { ISFUNC, rl_emacs_editing_mode },   /* Control-e */
13156 -  { ISFUNC, (Function *)0x0 },         /* Control-f */
13157 -  { ISFUNC, rl_abort },                        /* Control-g */
13158 -  { ISFUNC, rl_backward },             /* Control-h */
13159 -  { ISFUNC, (Function *)0x0 },         /* Control-i */
13160 -  { ISFUNC, rl_newline },              /* Control-j */
13161 -  { ISFUNC, rl_kill_line },            /* Control-k */
13162 -  { ISFUNC, rl_clear_screen },         /* Control-l */
13163 -  { ISFUNC, rl_newline },              /* Control-m */
13164 -  { ISFUNC, rl_get_next_history },     /* Control-n */
13165 -  { ISFUNC, (Function *)0x0 },         /* Control-o */
13166 -  { ISFUNC, rl_get_previous_history }, /* Control-p */
13167 -  { ISFUNC, rl_quoted_insert },                /* Control-q */
13168 -  { ISFUNC, rl_reverse_search_history }, /* Control-r */
13169 -  { ISFUNC, rl_forward_search_history }, /* Control-s */
13170 -  { ISFUNC, rl_transpose_chars },      /* Control-t */
13171 -  { ISFUNC, rl_unix_line_discard },    /* Control-u */
13172 -  { ISFUNC, rl_quoted_insert },                /* Control-v */
13173 -  { ISFUNC, rl_unix_word_rubout },     /* Control-w */
13174 -  { ISFUNC, (Function *)0x0 },         /* Control-x */
13175 -  { ISFUNC, rl_yank },                 /* Control-y */
13176 -  { ISFUNC, (Function *)0x0 },         /* Control-z */
13178 -  { ISFUNC, (Function *)0x0 },         /* Control-[ */ /* vi_escape_keymap */
13179 -  { ISFUNC, (Function *)0x0 },         /* Control-\ */
13180 -  { ISFUNC, (Function *)0x0 },         /* Control-] */
13181 -  { ISFUNC, (Function *)0x0 },         /* Control-^ */
13182 -  { ISFUNC, rl_vi_undo },              /* Control-_ */
13183 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-@ */
13184 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-a */
13185 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-b */
13186 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-c */
13187 +  { ISFUNC, rl_vi_eof_maybe },                 /* Control-d */
13188 +  { ISFUNC, rl_emacs_editing_mode },           /* Control-e */
13189 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-f */
13190 +  { ISFUNC, rl_abort },                                /* Control-g */
13191 +  { ISFUNC, rl_backward },                     /* Control-h */
13192 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-i */
13193 +  { ISFUNC, rl_newline },                      /* Control-j */
13194 +  { ISFUNC, rl_kill_line },                    /* Control-k */
13195 +  { ISFUNC, rl_clear_screen },                 /* Control-l */
13196 +  { ISFUNC, rl_newline },                      /* Control-m */
13197 +  { ISFUNC, rl_get_next_history },             /* Control-n */
13198 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-o */
13199 +  { ISFUNC, rl_get_previous_history },         /* Control-p */
13200 +  { ISFUNC, rl_quoted_insert },                        /* Control-q */
13201 +  { ISFUNC, rl_reverse_search_history },       /* Control-r */
13202 +  { ISFUNC, rl_forward_search_history },       /* Control-s */
13203 +  { ISFUNC, rl_transpose_chars },              /* Control-t */
13204 +  { ISFUNC, rl_unix_line_discard },            /* Control-u */
13205 +  { ISFUNC, rl_quoted_insert },                        /* Control-v */
13206 +  { ISFUNC, rl_unix_word_rubout },             /* Control-w */
13207 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-x */
13208 +  { ISFUNC, rl_yank },                         /* Control-y */
13209 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-z */
13211 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-[ */ /* vi_escape_keymap */
13212 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-\ */
13213 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-] */
13214 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-^ */
13215 +  { ISFUNC, rl_vi_undo },                      /* Control-_ */
13217    /* The start of printing characters. */
13218 -  { ISFUNC, rl_forward },              /* SPACE */
13219 -  { ISFUNC, (Function *)0x0 },         /* ! */
13220 -  { ISFUNC, (Function *)0x0 },         /* " */
13221 -  { ISFUNC, rl_insert_comment },       /* # */
13222 -  { ISFUNC, rl_end_of_line },          /* $ */
13223 -  { ISFUNC, rl_vi_match },             /* % */
13224 -  { ISFUNC, rl_vi_tilde_expand },      /* & */
13225 -  { ISFUNC, (Function *)0x0 },         /* ' */
13226 -  { ISFUNC, (Function *)0x0 },         /* ( */
13227 -  { ISFUNC, (Function *)0x0 },         /* ) */
13228 -  { ISFUNC, rl_vi_complete },          /* * */
13229 -  { ISFUNC, rl_get_next_history},      /* + */
13230 -  { ISFUNC, rl_vi_char_search },       /* , */
13231 -  { ISFUNC, rl_get_previous_history }, /* - */
13232 -  { ISFUNC, rl_vi_redo },              /* . */
13233 -  { ISFUNC, rl_vi_search },            /* / */
13234 +  { ISFUNC, rl_forward },                      /* SPACE */
13235 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ! */
13236 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* " */
13237 +  { ISFUNC, rl_insert_comment },               /* # */
13238 +  { ISFUNC, rl_end_of_line },                  /* $ */
13239 +  { ISFUNC, rl_vi_match },                     /* % */
13240 +  { ISFUNC, rl_vi_tilde_expand },              /* & */
13241 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ' */
13242 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ( */
13243 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ) */
13244 +  { ISFUNC, rl_vi_complete },                  /* * */
13245 +  { ISFUNC, rl_get_next_history},              /* + */
13246 +  { ISFUNC, rl_vi_char_search },               /* , */
13247 +  { ISFUNC, rl_get_previous_history },         /* - */
13248 +  { ISFUNC, rl_vi_redo },                      /* . */
13249 +  { ISFUNC, rl_vi_search },                    /* / */
13251    /* Regular digits. */
13252 -  { ISFUNC, rl_beg_of_line },          /* 0 */
13253 -  { ISFUNC, rl_vi_arg_digit },         /* 1 */
13254 -  { ISFUNC, rl_vi_arg_digit },         /* 2 */
13255 -  { ISFUNC, rl_vi_arg_digit },         /* 3 */
13256 -  { ISFUNC, rl_vi_arg_digit },         /* 4 */
13257 -  { ISFUNC, rl_vi_arg_digit },         /* 5 */
13258 -  { ISFUNC, rl_vi_arg_digit },         /* 6 */
13259 -  { ISFUNC, rl_vi_arg_digit },         /* 7 */
13260 -  { ISFUNC, rl_vi_arg_digit },         /* 8 */
13261 -  { ISFUNC, rl_vi_arg_digit },         /* 9 */
13262 +  { ISFUNC, rl_beg_of_line },                  /* 0 */
13263 +  { ISFUNC, rl_vi_arg_digit },                 /* 1 */
13264 +  { ISFUNC, rl_vi_arg_digit },                 /* 2 */
13265 +  { ISFUNC, rl_vi_arg_digit },                 /* 3 */
13266 +  { ISFUNC, rl_vi_arg_digit },                 /* 4 */
13267 +  { ISFUNC, rl_vi_arg_digit },                 /* 5 */
13268 +  { ISFUNC, rl_vi_arg_digit },                 /* 6 */
13269 +  { ISFUNC, rl_vi_arg_digit },                 /* 7 */
13270 +  { ISFUNC, rl_vi_arg_digit },                 /* 8 */
13271 +  { ISFUNC, rl_vi_arg_digit },                 /* 9 */
13273    /* A little more punctuation. */
13274 -  { ISFUNC, (Function *)0x0 },         /* : */
13275 -  { ISFUNC, rl_vi_char_search },       /* ; */
13276 -  { ISFUNC, (Function *)0x0 },         /* < */
13277 -  { ISFUNC, rl_vi_complete },          /* = */
13278 -  { ISFUNC, (Function *)0x0 },         /* > */
13279 -  { ISFUNC, rl_vi_search },            /* ? */
13280 -  { ISFUNC, (Function *)0x0 },         /* @ */
13281 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* : */
13282 +  { ISFUNC, rl_vi_char_search },               /* ; */
13283 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* < */
13284 +  { ISFUNC, rl_vi_complete },                  /* = */
13285 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* > */
13286 +  { ISFUNC, rl_vi_search },                    /* ? */
13287 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* @ */
13289    /* Uppercase alphabet. */
13290 -  { ISFUNC, rl_vi_append_eol },                /* A */
13291 -  { ISFUNC, rl_vi_prev_word},          /* B */
13292 -  { ISFUNC, rl_vi_change_to },         /* C */
13293 -  { ISFUNC, rl_vi_delete_to },         /* D */
13294 -  { ISFUNC, rl_vi_end_word },          /* E */
13295 -  { ISFUNC, rl_vi_char_search },       /* F */
13296 -  { ISFUNC, rl_vi_fetch_history },     /* G */
13297 -  { ISFUNC, (Function *)0x0 },         /* H */
13298 -  { ISFUNC, rl_vi_insert_beg },                /* I */
13299 -  { ISFUNC, (Function *)0x0 },         /* J */
13300 -  { ISFUNC, (Function *)0x0 },         /* K */
13301 -  { ISFUNC, (Function *)0x0 },         /* L */
13302 -  { ISFUNC, (Function *)0x0 },         /* M */
13303 -  { ISFUNC, rl_vi_search_again },      /* N */
13304 -  { ISFUNC, (Function *)0x0 },         /* O */
13305 -  { ISFUNC, rl_vi_put },               /* P */
13306 -  { ISFUNC, (Function *)0x0 },         /* Q */
13307 -  { ISFUNC, rl_vi_replace },           /* R */
13308 -  { ISFUNC, rl_vi_subst },             /* S */
13309 -  { ISFUNC, rl_vi_char_search },       /* T */
13310 -  { ISFUNC, rl_revert_line },          /* U */
13311 -  { ISFUNC, (Function *)0x0 },         /* V */
13312 -  { ISFUNC, rl_vi_next_word },         /* W */
13313 -  { ISFUNC, rl_rubout },               /* X */
13314 -  { ISFUNC, rl_vi_yank_to },           /* Y */
13315 -  { ISFUNC, (Function *)0x0 },         /* Z */
13316 +  { ISFUNC, rl_vi_append_eol },                        /* A */
13317 +  { ISFUNC, rl_vi_prev_word},                  /* B */
13318 +  { ISFUNC, rl_vi_change_to },                 /* C */
13319 +  { ISFUNC, rl_vi_delete_to },                 /* D */
13320 +  { ISFUNC, rl_vi_end_word },                  /* E */
13321 +  { ISFUNC, rl_vi_char_search },               /* F */
13322 +  { ISFUNC, rl_vi_fetch_history },             /* G */
13323 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* H */
13324 +  { ISFUNC, rl_vi_insert_beg },                        /* I */
13325 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* J */
13326 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* K */
13327 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* L */
13328 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* M */
13329 +  { ISFUNC, rl_vi_search_again },              /* N */
13330 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* O */
13331 +  { ISFUNC, rl_vi_put },                       /* P */
13332 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Q */
13333 +  { ISFUNC, rl_vi_replace },                   /* R */
13334 +  { ISFUNC, rl_vi_subst },                     /* S */
13335 +  { ISFUNC, rl_vi_char_search },               /* T */
13336 +  { ISFUNC, rl_revert_line },                  /* U */
13337 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* V */
13338 +  { ISFUNC, rl_vi_next_word },                 /* W */
13339 +  { ISFUNC, rl_rubout },                       /* X */
13340 +  { ISFUNC, rl_vi_yank_to },                   /* Y */
13341 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Z */
13343    /* Some more punctuation. */
13344 -  { ISFUNC, (Function *)0x0 },         /* [ */
13345 -  { ISFUNC, rl_vi_complete },          /* \ */
13346 -  { ISFUNC, (Function *)0x0 },         /* ] */
13347 -  { ISFUNC, rl_vi_first_print },       /* ^ */
13348 -  { ISFUNC, rl_vi_yank_arg },          /* _ */
13349 -  { ISFUNC, rl_vi_goto_mark },         /* ` */
13350 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* [ */
13351 +  { ISFUNC, rl_vi_complete },                  /* \ */
13352 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ] */
13353 +  { ISFUNC, rl_vi_first_print },               /* ^ */
13354 +  { ISFUNC, rl_vi_yank_arg },                  /* _ */
13355 +  { ISFUNC, rl_vi_goto_mark },                 /* ` */
13357    /* Lowercase alphabet. */
13358 -  { ISFUNC, rl_vi_append_mode },       /* a */
13359 -  { ISFUNC, rl_vi_prev_word },         /* b */
13360 -  { ISFUNC, rl_vi_change_to },         /* c */
13361 -  { ISFUNC, rl_vi_delete_to },         /* d */
13362 -  { ISFUNC, rl_vi_end_word },          /* e */
13363 -  { ISFUNC, rl_vi_char_search },       /* f */
13364 -  { ISFUNC, (Function *)0x0 },         /* g */
13365 -  { ISFUNC, rl_backward },             /* h */
13366 -  { ISFUNC, rl_vi_insertion_mode },    /* i */
13367 -  { ISFUNC, rl_get_next_history },     /* j */
13368 -  { ISFUNC, rl_get_previous_history }, /* k */
13369 -  { ISFUNC, rl_forward },              /* l */
13370 -  { ISFUNC, rl_vi_set_mark },          /* m */
13371 -  { ISFUNC, rl_vi_search_again },      /* n */
13372 -  { ISFUNC, (Function *)0x0 },         /* o */
13373 -  { ISFUNC, rl_vi_put },               /* p */
13374 -  { ISFUNC, (Function *)0x0 },         /* q */
13375 -  { ISFUNC, rl_vi_change_char },       /* r */
13376 -  { ISFUNC, rl_vi_subst },             /* s */
13377 -  { ISFUNC, rl_vi_char_search },       /* t */
13378 -  { ISFUNC, rl_vi_undo },              /* u */
13379 -  { ISFUNC, (Function *)0x0 },         /* v */
13380 -  { ISFUNC, rl_vi_next_word },         /* w */
13381 -  { ISFUNC, rl_vi_delete },            /* x */
13382 -  { ISFUNC, rl_vi_yank_to },           /* y */
13383 -  { ISFUNC, (Function *)0x0 },         /* z */
13384 +  { ISFUNC, rl_vi_append_mode },               /* a */
13385 +  { ISFUNC, rl_vi_prev_word },                 /* b */
13386 +  { ISFUNC, rl_vi_change_to },                 /* c */
13387 +  { ISFUNC, rl_vi_delete_to },                 /* d */
13388 +  { ISFUNC, rl_vi_end_word },                  /* e */
13389 +  { ISFUNC, rl_vi_char_search },               /* f */
13390 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* g */
13391 +  { ISFUNC, rl_backward },                     /* h */
13392 +  { ISFUNC, rl_vi_insertion_mode },            /* i */
13393 +  { ISFUNC, rl_get_next_history },             /* j */
13394 +  { ISFUNC, rl_get_previous_history },         /* k */
13395 +  { ISFUNC, rl_forward },                      /* l */
13396 +  { ISFUNC, rl_vi_set_mark },                  /* m */
13397 +  { ISFUNC, rl_vi_search_again },              /* n */
13398 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* o */
13399 +  { ISFUNC, rl_vi_put },                       /* p */
13400 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* q */
13401 +  { ISFUNC, rl_vi_change_char },               /* r */
13402 +  { ISFUNC, rl_vi_subst },                     /* s */
13403 +  { ISFUNC, rl_vi_char_search },               /* t */
13404 +  { ISFUNC, rl_vi_undo },                      /* u */
13405 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* v */
13406 +  { ISFUNC, rl_vi_next_word },                 /* w */
13407 +  { ISFUNC, rl_vi_delete },                    /* x */
13408 +  { ISFUNC, rl_vi_yank_to },                   /* y */
13409 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* z */
13411    /* Final punctuation. */
13412 -  { ISFUNC, (Function *)0x0 },         /* { */
13413 -  { ISFUNC, rl_vi_column },            /* | */
13414 -  { ISFUNC, (Function *)0x0 },         /* } */
13415 -  { ISFUNC, rl_vi_change_case },       /* ~ */
13416 -  { ISFUNC, (Function *)0x0 },         /* RUBOUT */
13417 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* { */
13418 +  { ISFUNC, rl_vi_column },                    /* | */
13419 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* } */
13420 +  { ISFUNC, rl_vi_change_case },               /* ~ */
13421 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* RUBOUT */
13423  #if KEYMAP_SIZE > 128
13424    /* Undefined keys. */
13425 -  { ISFUNC, (Function *)0x0 },
13426 -  { ISFUNC, (Function *)0x0 },
13427 -  { ISFUNC, (Function *)0x0 },
13428 -  { ISFUNC, (Function *)0x0 },
13429 -  { ISFUNC, (Function *)0x0 },
13430 -  { ISFUNC, (Function *)0x0 },
13431 -  { ISFUNC, (Function *)0x0 },
13432 -  { ISFUNC, (Function *)0x0 },
13433 -  { ISFUNC, (Function *)0x0 },
13434 -  { ISFUNC, (Function *)0x0 },
13435 -  { ISFUNC, (Function *)0x0 },
13436 -  { ISFUNC, (Function *)0x0 },
13437 -  { ISFUNC, (Function *)0x0 },
13438 -  { ISFUNC, (Function *)0x0 },
13439 -  { ISFUNC, (Function *)0x0 },
13440 -  { ISFUNC, (Function *)0x0 },
13441 -  { ISFUNC, (Function *)0x0 },
13442 -  { ISFUNC, (Function *)0x0 },
13443 -  { ISFUNC, (Function *)0x0 },
13444 -  { ISFUNC, (Function *)0x0 },
13445 -  { ISFUNC, (Function *)0x0 },
13446 -  { ISFUNC, (Function *)0x0 },
13447 -  { ISFUNC, (Function *)0x0 },
13448 -  { ISFUNC, (Function *)0x0 },
13449 -  { ISFUNC, (Function *)0x0 },
13450 -  { ISFUNC, (Function *)0x0 },
13451 -  { ISFUNC, (Function *)0x0 },
13452 -  { ISFUNC, (Function *)0x0 },
13453 -  { ISFUNC, (Function *)0x0 },
13454 -  { ISFUNC, (Function *)0x0 },
13455 -  { ISFUNC, (Function *)0x0 },
13456 -  { ISFUNC, (Function *)0x0 },
13457 -  { ISFUNC, (Function *)0x0 },
13458 -  { ISFUNC, (Function *)0x0 },
13459 -  { ISFUNC, (Function *)0x0 },
13460 -  { ISFUNC, (Function *)0x0 },
13461 -  { ISFUNC, (Function *)0x0 },
13462 -  { ISFUNC, (Function *)0x0 },
13463 -  { ISFUNC, (Function *)0x0 },
13464 -  { ISFUNC, (Function *)0x0 },
13465 -  { ISFUNC, (Function *)0x0 },
13466 -  { ISFUNC, (Function *)0x0 },
13467 -  { ISFUNC, (Function *)0x0 },
13468 -  { ISFUNC, (Function *)0x0 },
13469 -  { ISFUNC, (Function *)0x0 },
13470 -  { ISFUNC, (Function *)0x0 },
13471 -  { ISFUNC, (Function *)0x0 },
13472 -  { ISFUNC, (Function *)0x0 },
13473 -  { ISFUNC, (Function *)0x0 },
13474 -  { ISFUNC, (Function *)0x0 },
13475 -  { ISFUNC, (Function *)0x0 },
13476 -  { ISFUNC, (Function *)0x0 },
13477 -  { ISFUNC, (Function *)0x0 },
13478 -  { ISFUNC, (Function *)0x0 },
13479 -  { ISFUNC, (Function *)0x0 },
13480 -  { ISFUNC, (Function *)0x0 },
13481 -  { ISFUNC, (Function *)0x0 },
13482 -  { ISFUNC, (Function *)0x0 },
13483 -  { ISFUNC, (Function *)0x0 },
13484 -  { ISFUNC, (Function *)0x0 },
13485 -  { ISFUNC, (Function *)0x0 },
13486 -  { ISFUNC, (Function *)0x0 },
13487 -  { ISFUNC, (Function *)0x0 },
13488 -  { ISFUNC, (Function *)0x0 },
13489 -  { ISFUNC, (Function *)0x0 },
13490 -  { ISFUNC, (Function *)0x0 },
13491 -  { ISFUNC, (Function *)0x0 },
13492 -  { ISFUNC, (Function *)0x0 },
13493 -  { ISFUNC, (Function *)0x0 },
13494 -  { ISFUNC, (Function *)0x0 },
13495 -  { ISFUNC, (Function *)0x0 },
13496 -  { ISFUNC, (Function *)0x0 },
13497 -  { ISFUNC, (Function *)0x0 },
13498 -  { ISFUNC, (Function *)0x0 },
13499 -  { ISFUNC, (Function *)0x0 },
13500 -  { ISFUNC, (Function *)0x0 },
13501 -  { ISFUNC, (Function *)0x0 },
13502 -  { ISFUNC, (Function *)0x0 },
13503 -  { ISFUNC, (Function *)0x0 },
13504 -  { ISFUNC, (Function *)0x0 },
13505 -  { ISFUNC, (Function *)0x0 },
13506 -  { ISFUNC, (Function *)0x0 },
13507 -  { ISFUNC, (Function *)0x0 },
13508 -  { ISFUNC, (Function *)0x0 },
13509 -  { ISFUNC, (Function *)0x0 },
13510 -  { ISFUNC, (Function *)0x0 },
13511 -  { ISFUNC, (Function *)0x0 },
13512 -  { ISFUNC, (Function *)0x0 },
13513 -  { ISFUNC, (Function *)0x0 },
13514 -  { ISFUNC, (Function *)0x0 },
13515 -  { ISFUNC, (Function *)0x0 },
13516 -  { ISFUNC, (Function *)0x0 },
13517 -  { ISFUNC, (Function *)0x0 },
13518 -  { ISFUNC, (Function *)0x0 },
13519 -  { ISFUNC, (Function *)0x0 },
13520 -  { ISFUNC, (Function *)0x0 },
13521 -  { ISFUNC, (Function *)0x0 },
13522 -  { ISFUNC, (Function *)0x0 },
13523 -  { ISFUNC, (Function *)0x0 },
13524 -  { ISFUNC, (Function *)0x0 },
13525 -  { ISFUNC, (Function *)0x0 },
13526 -  { ISFUNC, (Function *)0x0 },
13527 -  { ISFUNC, (Function *)0x0 },
13528 -  { ISFUNC, (Function *)0x0 },
13529 -  { ISFUNC, (Function *)0x0 },
13530 -  { ISFUNC, (Function *)0x0 },
13531 -  { ISFUNC, (Function *)0x0 },
13532 -  { ISFUNC, (Function *)0x0 },
13533 -  { ISFUNC, (Function *)0x0 },
13534 -  { ISFUNC, (Function *)0x0 },
13535 -  { ISFUNC, (Function *)0x0 },
13536 -  { ISFUNC, (Function *)0x0 },
13537 -  { ISFUNC, (Function *)0x0 },
13538 -  { ISFUNC, (Function *)0x0 },
13539 -  { ISFUNC, (Function *)0x0 },
13540 -  { ISFUNC, (Function *)0x0 },
13541 -  { ISFUNC, (Function *)0x0 },
13542 -  { ISFUNC, (Function *)0x0 },
13543 -  { ISFUNC, (Function *)0x0 },
13544 -  { ISFUNC, (Function *)0x0 },
13545 -  { ISFUNC, (Function *)0x0 },
13546 -  { ISFUNC, (Function *)0x0 },
13547 -  { ISFUNC, (Function *)0x0 },
13548 -  { ISFUNC, (Function *)0x0 },
13549 -  { ISFUNC, (Function *)0x0 },
13550 -  { ISFUNC, (Function *)0x0 },
13551 -  { ISFUNC, (Function *)0x0 },
13552 -  { ISFUNC, (Function *)0x0 }
13553 +  { ISFUNC, (rl_command_func_t *)0x0 },
13554 +  { ISFUNC, (rl_command_func_t *)0x0 },
13555 +  { ISFUNC, (rl_command_func_t *)0x0 },
13556 +  { ISFUNC, (rl_command_func_t *)0x0 },
13557 +  { ISFUNC, (rl_command_func_t *)0x0 },
13558 +  { ISFUNC, (rl_command_func_t *)0x0 },
13559 +  { ISFUNC, (rl_command_func_t *)0x0 },
13560 +  { ISFUNC, (rl_command_func_t *)0x0 },
13561 +  { ISFUNC, (rl_command_func_t *)0x0 },
13562 +  { ISFUNC, (rl_command_func_t *)0x0 },
13563 +  { ISFUNC, (rl_command_func_t *)0x0 },
13564 +  { ISFUNC, (rl_command_func_t *)0x0 },
13565 +  { ISFUNC, (rl_command_func_t *)0x0 },
13566 +  { ISFUNC, (rl_command_func_t *)0x0 },
13567 +  { ISFUNC, (rl_command_func_t *)0x0 },
13568 +  { ISFUNC, (rl_command_func_t *)0x0 },
13569 +  { ISFUNC, (rl_command_func_t *)0x0 },
13570 +  { ISFUNC, (rl_command_func_t *)0x0 },
13571 +  { ISFUNC, (rl_command_func_t *)0x0 },
13572 +  { ISFUNC, (rl_command_func_t *)0x0 },
13573 +  { ISFUNC, (rl_command_func_t *)0x0 },
13574 +  { ISFUNC, (rl_command_func_t *)0x0 },
13575 +  { ISFUNC, (rl_command_func_t *)0x0 },
13576 +  { ISFUNC, (rl_command_func_t *)0x0 },
13577 +  { ISFUNC, (rl_command_func_t *)0x0 },
13578 +  { ISFUNC, (rl_command_func_t *)0x0 },
13579 +  { ISFUNC, (rl_command_func_t *)0x0 },
13580 +  { ISFUNC, (rl_command_func_t *)0x0 },
13581 +  { ISFUNC, (rl_command_func_t *)0x0 },
13582 +  { ISFUNC, (rl_command_func_t *)0x0 },
13583 +  { ISFUNC, (rl_command_func_t *)0x0 },
13584 +  { ISFUNC, (rl_command_func_t *)0x0 },
13585 +  { ISFUNC, (rl_command_func_t *)0x0 },
13586 +  { ISFUNC, (rl_command_func_t *)0x0 },
13587 +  { ISFUNC, (rl_command_func_t *)0x0 },
13588 +  { ISFUNC, (rl_command_func_t *)0x0 },
13589 +  { ISFUNC, (rl_command_func_t *)0x0 },
13590 +  { ISFUNC, (rl_command_func_t *)0x0 },
13591 +  { ISFUNC, (rl_command_func_t *)0x0 },
13592 +  { ISFUNC, (rl_command_func_t *)0x0 },
13593 +  { ISFUNC, (rl_command_func_t *)0x0 },
13594 +  { ISFUNC, (rl_command_func_t *)0x0 },
13595 +  { ISFUNC, (rl_command_func_t *)0x0 },
13596 +  { ISFUNC, (rl_command_func_t *)0x0 },
13597 +  { ISFUNC, (rl_command_func_t *)0x0 },
13598 +  { ISFUNC, (rl_command_func_t *)0x0 },
13599 +  { ISFUNC, (rl_command_func_t *)0x0 },
13600 +  { ISFUNC, (rl_command_func_t *)0x0 },
13601 +  { ISFUNC, (rl_command_func_t *)0x0 },
13602 +  { ISFUNC, (rl_command_func_t *)0x0 },
13603 +  { ISFUNC, (rl_command_func_t *)0x0 },
13604 +  { ISFUNC, (rl_command_func_t *)0x0 },
13605 +  { ISFUNC, (rl_command_func_t *)0x0 },
13606 +  { ISFUNC, (rl_command_func_t *)0x0 },
13607 +  { ISFUNC, (rl_command_func_t *)0x0 },
13608 +  { ISFUNC, (rl_command_func_t *)0x0 },
13609 +  { ISFUNC, (rl_command_func_t *)0x0 },
13610 +  { ISFUNC, (rl_command_func_t *)0x0 },
13611 +  { ISFUNC, (rl_command_func_t *)0x0 },
13612 +  { ISFUNC, (rl_command_func_t *)0x0 },
13613 +  { ISFUNC, (rl_command_func_t *)0x0 },
13614 +  { ISFUNC, (rl_command_func_t *)0x0 },
13615 +  { ISFUNC, (rl_command_func_t *)0x0 },
13616 +  { ISFUNC, (rl_command_func_t *)0x0 },
13617 +  { ISFUNC, (rl_command_func_t *)0x0 },
13618 +  { ISFUNC, (rl_command_func_t *)0x0 },
13619 +  { ISFUNC, (rl_command_func_t *)0x0 },
13620 +  { ISFUNC, (rl_command_func_t *)0x0 },
13621 +  { ISFUNC, (rl_command_func_t *)0x0 },
13622 +  { ISFUNC, (rl_command_func_t *)0x0 },
13623 +  { ISFUNC, (rl_command_func_t *)0x0 },
13624 +  { ISFUNC, (rl_command_func_t *)0x0 },
13625 +  { ISFUNC, (rl_command_func_t *)0x0 },
13626 +  { ISFUNC, (rl_command_func_t *)0x0 },
13627 +  { ISFUNC, (rl_command_func_t *)0x0 },
13628 +  { ISFUNC, (rl_command_func_t *)0x0 },
13629 +  { ISFUNC, (rl_command_func_t *)0x0 },
13630 +  { ISFUNC, (rl_command_func_t *)0x0 },
13631 +  { ISFUNC, (rl_command_func_t *)0x0 },
13632 +  { ISFUNC, (rl_command_func_t *)0x0 },
13633 +  { ISFUNC, (rl_command_func_t *)0x0 },
13634 +  { ISFUNC, (rl_command_func_t *)0x0 },
13635 +  { ISFUNC, (rl_command_func_t *)0x0 },
13636 +  { ISFUNC, (rl_command_func_t *)0x0 },
13637 +  { ISFUNC, (rl_command_func_t *)0x0 },
13638 +  { ISFUNC, (rl_command_func_t *)0x0 },
13639 +  { ISFUNC, (rl_command_func_t *)0x0 },
13640 +  { ISFUNC, (rl_command_func_t *)0x0 },
13641 +  { ISFUNC, (rl_command_func_t *)0x0 },
13642 +  { ISFUNC, (rl_command_func_t *)0x0 },
13643 +  { ISFUNC, (rl_command_func_t *)0x0 },
13644 +  { ISFUNC, (rl_command_func_t *)0x0 },
13645 +  { ISFUNC, (rl_command_func_t *)0x0 },
13646 +  { ISFUNC, (rl_command_func_t *)0x0 },
13647 +  { ISFUNC, (rl_command_func_t *)0x0 },
13648 +  { ISFUNC, (rl_command_func_t *)0x0 },
13649 +  { ISFUNC, (rl_command_func_t *)0x0 },
13650 +  { ISFUNC, (rl_command_func_t *)0x0 },
13651 +  { ISFUNC, (rl_command_func_t *)0x0 },
13652 +  { ISFUNC, (rl_command_func_t *)0x0 },
13653 +  { ISFUNC, (rl_command_func_t *)0x0 },
13654 +  { ISFUNC, (rl_command_func_t *)0x0 },
13655 +  { ISFUNC, (rl_command_func_t *)0x0 },
13656 +  { ISFUNC, (rl_command_func_t *)0x0 },
13657 +  { ISFUNC, (rl_command_func_t *)0x0 },
13658 +  { ISFUNC, (rl_command_func_t *)0x0 },
13659 +  { ISFUNC, (rl_command_func_t *)0x0 },
13660 +  { ISFUNC, (rl_command_func_t *)0x0 },
13661 +  { ISFUNC, (rl_command_func_t *)0x0 },
13662 +  { ISFUNC, (rl_command_func_t *)0x0 },
13663 +  { ISFUNC, (rl_command_func_t *)0x0 },
13664 +  { ISFUNC, (rl_command_func_t *)0x0 },
13665 +  { ISFUNC, (rl_command_func_t *)0x0 },
13666 +  { ISFUNC, (rl_command_func_t *)0x0 },
13667 +  { ISFUNC, (rl_command_func_t *)0x0 },
13668 +  { ISFUNC, (rl_command_func_t *)0x0 },
13669 +  { ISFUNC, (rl_command_func_t *)0x0 },
13670 +  { ISFUNC, (rl_command_func_t *)0x0 },
13671 +  { ISFUNC, (rl_command_func_t *)0x0 },
13672 +  { ISFUNC, (rl_command_func_t *)0x0 },
13673 +  { ISFUNC, (rl_command_func_t *)0x0 },
13674 +  { ISFUNC, (rl_command_func_t *)0x0 },
13675 +  { ISFUNC, (rl_command_func_t *)0x0 },
13676 +  { ISFUNC, (rl_command_func_t *)0x0 },
13677 +  { ISFUNC, (rl_command_func_t *)0x0 },
13678 +  { ISFUNC, (rl_command_func_t *)0x0 },
13679 +  { ISFUNC, (rl_command_func_t *)0x0 },
13680 +  { ISFUNC, (rl_command_func_t *)0x0 }
13681  #endif /* KEYMAP_SIZE > 128 */
13682  };
13685  KEYMAP_ENTRY_ARRAY vi_insertion_keymap = {
13686    /* The regular control keys come first. */
13687 -  { ISFUNC, (Function *)0x0 },         /* Control-@ */
13688 -  { ISFUNC, rl_insert },               /* Control-a */
13689 -  { ISFUNC, rl_insert },               /* Control-b */
13690 -  { ISFUNC, rl_insert },               /* Control-c */
13691 -  { ISFUNC, rl_vi_eof_maybe },         /* Control-d */
13692 -  { ISFUNC, rl_insert },               /* Control-e */
13693 -  { ISFUNC, rl_insert },               /* Control-f */
13694 -  { ISFUNC, rl_insert },               /* Control-g */
13695 -  { ISFUNC, rl_rubout },               /* Control-h */
13696 -  { ISFUNC, rl_complete },             /* Control-i */
13697 -  { ISFUNC, rl_newline },              /* Control-j */
13698 -  { ISFUNC, rl_insert },               /* Control-k */
13699 -  { ISFUNC, rl_insert },               /* Control-l */
13700 -  { ISFUNC, rl_newline },              /* Control-m */
13701 -  { ISFUNC, rl_insert },               /* Control-n */
13702 -  { ISFUNC, rl_insert },               /* Control-o */
13703 -  { ISFUNC, rl_insert },               /* Control-p */
13704 -  { ISFUNC, rl_insert },               /* Control-q */
13705 -  { ISFUNC, rl_reverse_search_history }, /* Control-r */
13706 -  { ISFUNC, rl_forward_search_history }, /* Control-s */
13707 -  { ISFUNC, rl_transpose_chars },      /* Control-t */
13708 -  { ISFUNC, rl_unix_line_discard },    /* Control-u */
13709 -  { ISFUNC, rl_quoted_insert },                /* Control-v */
13710 -  { ISFUNC, rl_unix_word_rubout },     /* Control-w */
13711 -  { ISFUNC, rl_insert },               /* Control-x */
13712 -  { ISFUNC, rl_yank },                 /* Control-y */
13713 -  { ISFUNC, rl_insert },               /* Control-z */
13715 -  { ISFUNC, rl_vi_movement_mode },     /* Control-[ */
13716 -  { ISFUNC, rl_insert },               /* Control-\ */
13717 -  { ISFUNC, rl_insert },               /* Control-] */
13718 -  { ISFUNC, rl_insert },               /* Control-^ */
13719 -  { ISFUNC, rl_vi_undo },              /* Control-_ */
13720 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-@ */
13721 +  { ISFUNC, rl_insert },                       /* Control-a */
13722 +  { ISFUNC, rl_insert },                       /* Control-b */
13723 +  { ISFUNC, rl_insert },                       /* Control-c */
13724 +  { ISFUNC, rl_vi_eof_maybe },                 /* Control-d */
13725 +  { ISFUNC, rl_insert },                       /* Control-e */
13726 +  { ISFUNC, rl_insert },                       /* Control-f */
13727 +  { ISFUNC, rl_insert },                       /* Control-g */
13728 +  { ISFUNC, rl_rubout },                       /* Control-h */
13729 +  { ISFUNC, rl_complete },                     /* Control-i */
13730 +  { ISFUNC, rl_newline },                      /* Control-j */
13731 +  { ISFUNC, rl_insert },                       /* Control-k */
13732 +  { ISFUNC, rl_insert },                       /* Control-l */
13733 +  { ISFUNC, rl_newline },                      /* Control-m */
13734 +  { ISFUNC, rl_insert },                       /* Control-n */
13735 +  { ISFUNC, rl_insert },                       /* Control-o */
13736 +  { ISFUNC, rl_insert },                       /* Control-p */
13737 +  { ISFUNC, rl_insert },                       /* Control-q */
13738 +  { ISFUNC, rl_reverse_search_history },       /* Control-r */
13739 +  { ISFUNC, rl_forward_search_history },       /* Control-s */
13740 +  { ISFUNC, rl_transpose_chars },              /* Control-t */
13741 +  { ISFUNC, rl_unix_line_discard },            /* Control-u */
13742 +  { ISFUNC, rl_quoted_insert },                        /* Control-v */
13743 +  { ISFUNC, rl_unix_word_rubout },             /* Control-w */
13744 +  { ISFUNC, rl_insert },                       /* Control-x */
13745 +  { ISFUNC, rl_yank },                         /* Control-y */
13746 +  { ISFUNC, rl_insert },                       /* Control-z */
13748 +  { ISFUNC, rl_vi_movement_mode },             /* Control-[ */
13749 +  { ISFUNC, rl_insert },                       /* Control-\ */
13750 +  { ISFUNC, rl_insert },                       /* Control-] */
13751 +  { ISFUNC, rl_insert },                       /* Control-^ */
13752 +  { ISFUNC, rl_vi_undo },                      /* Control-_ */
13754    /* The start of printing characters. */
13755 -  { ISFUNC, rl_insert },               /* SPACE */
13756 -  { ISFUNC, rl_insert },               /* ! */
13757 -  { ISFUNC, rl_insert },               /* " */
13758 -  { ISFUNC, rl_insert },               /* # */
13759 -  { ISFUNC, rl_insert },               /* $ */
13760 -  { ISFUNC, rl_insert },               /* % */
13761 -  { ISFUNC, rl_insert },               /* & */
13762 -  { ISFUNC, rl_insert },               /* ' */
13763 -  { ISFUNC, rl_insert },               /* ( */
13764 -  { ISFUNC, rl_insert },               /* ) */
13765 -  { ISFUNC, rl_insert },               /* * */
13766 -  { ISFUNC, rl_insert },               /* + */
13767 -  { ISFUNC, rl_insert },               /* , */
13768 -  { ISFUNC, rl_insert },               /* - */
13769 -  { ISFUNC, rl_insert },               /* . */
13770 -  { ISFUNC, rl_insert },               /* / */
13771 +  { ISFUNC, rl_insert },                       /* SPACE */
13772 +  { ISFUNC, rl_insert },                       /* ! */
13773 +  { ISFUNC, rl_insert },                       /* " */
13774 +  { ISFUNC, rl_insert },                       /* # */
13775 +  { ISFUNC, rl_insert },                       /* $ */
13776 +  { ISFUNC, rl_insert },                       /* % */
13777 +  { ISFUNC, rl_insert },                       /* & */
13778 +  { ISFUNC, rl_insert },                       /* ' */
13779 +  { ISFUNC, rl_insert },                       /* ( */
13780 +  { ISFUNC, rl_insert },                       /* ) */
13781 +  { ISFUNC, rl_insert },                       /* * */
13782 +  { ISFUNC, rl_insert },                       /* + */
13783 +  { ISFUNC, rl_insert },                       /* , */
13784 +  { ISFUNC, rl_insert },                       /* - */
13785 +  { ISFUNC, rl_insert },                       /* . */
13786 +  { ISFUNC, rl_insert },                       /* / */
13788    /* Regular digits. */
13789 -  { ISFUNC, rl_insert },               /* 0 */
13790 -  { ISFUNC, rl_insert },               /* 1 */
13791 -  { ISFUNC, rl_insert },               /* 2 */
13792 -  { ISFUNC, rl_insert },               /* 3 */
13793 -  { ISFUNC, rl_insert },               /* 4 */
13794 -  { ISFUNC, rl_insert },               /* 5 */
13795 -  { ISFUNC, rl_insert },               /* 6 */
13796 -  { ISFUNC, rl_insert },               /* 7 */
13797 -  { ISFUNC, rl_insert },               /* 8 */
13798 -  { ISFUNC, rl_insert },               /* 9 */
13799 +  { ISFUNC, rl_insert },                       /* 0 */
13800 +  { ISFUNC, rl_insert },                       /* 1 */
13801 +  { ISFUNC, rl_insert },                       /* 2 */
13802 +  { ISFUNC, rl_insert },                       /* 3 */
13803 +  { ISFUNC, rl_insert },                       /* 4 */
13804 +  { ISFUNC, rl_insert },                       /* 5 */
13805 +  { ISFUNC, rl_insert },                       /* 6 */
13806 +  { ISFUNC, rl_insert },                       /* 7 */
13807 +  { ISFUNC, rl_insert },                       /* 8 */
13808 +  { ISFUNC, rl_insert },                       /* 9 */
13810    /* A little more punctuation. */
13811 -  { ISFUNC, rl_insert },               /* : */
13812 -  { ISFUNC, rl_insert },               /* ; */
13813 -  { ISFUNC, rl_insert },               /* < */
13814 -  { ISFUNC, rl_insert },               /* = */
13815 -  { ISFUNC, rl_insert },               /* > */
13816 -  { ISFUNC, rl_insert },               /* ? */
13817 -  { ISFUNC, rl_insert },               /* @ */
13818 +  { ISFUNC, rl_insert },                       /* : */
13819 +  { ISFUNC, rl_insert },                       /* ; */
13820 +  { ISFUNC, rl_insert },                       /* < */
13821 +  { ISFUNC, rl_insert },                       /* = */
13822 +  { ISFUNC, rl_insert },                       /* > */
13823 +  { ISFUNC, rl_insert },                       /* ? */
13824 +  { ISFUNC, rl_insert },                       /* @ */
13826    /* Uppercase alphabet. */
13827 -  { ISFUNC, rl_insert },               /* A */
13828 -  { ISFUNC, rl_insert },               /* B */
13829 -  { ISFUNC, rl_insert },               /* C */
13830 -  { ISFUNC, rl_insert },               /* D */
13831 -  { ISFUNC, rl_insert },               /* E */
13832 -  { ISFUNC, rl_insert },               /* F */
13833 -  { ISFUNC, rl_insert },               /* G */
13834 -  { ISFUNC, rl_insert },               /* H */
13835 -  { ISFUNC, rl_insert },               /* I */
13836 -  { ISFUNC, rl_insert },               /* J */
13837 -  { ISFUNC, rl_insert },               /* K */
13838 -  { ISFUNC, rl_insert },               /* L */
13839 -  { ISFUNC, rl_insert },               /* M */
13840 -  { ISFUNC, rl_insert },               /* N */
13841 -  { ISFUNC, rl_insert },               /* O */
13842 -  { ISFUNC, rl_insert },               /* P */
13843 -  { ISFUNC, rl_insert },               /* Q */
13844 -  { ISFUNC, rl_insert },               /* R */
13845 -  { ISFUNC, rl_insert },               /* S */
13846 -  { ISFUNC, rl_insert },               /* T */
13847 -  { ISFUNC, rl_insert },               /* U */
13848 -  { ISFUNC, rl_insert },               /* V */
13849 -  { ISFUNC, rl_insert },               /* W */
13850 -  { ISFUNC, rl_insert },               /* X */
13851 -  { ISFUNC, rl_insert },               /* Y */
13852 -  { ISFUNC, rl_insert },               /* Z */
13853 +  { ISFUNC, rl_insert },                       /* A */
13854 +  { ISFUNC, rl_insert },                       /* B */
13855 +  { ISFUNC, rl_insert },                       /* C */
13856 +  { ISFUNC, rl_insert },                       /* D */
13857 +  { ISFUNC, rl_insert },                       /* E */
13858 +  { ISFUNC, rl_insert },                       /* F */
13859 +  { ISFUNC, rl_insert },                       /* G */
13860 +  { ISFUNC, rl_insert },                       /* H */
13861 +  { ISFUNC, rl_insert },                       /* I */
13862 +  { ISFUNC, rl_insert },                       /* J */
13863 +  { ISFUNC, rl_insert },                       /* K */
13864 +  { ISFUNC, rl_insert },                       /* L */
13865 +  { ISFUNC, rl_insert },                       /* M */
13866 +  { ISFUNC, rl_insert },                       /* N */
13867 +  { ISFUNC, rl_insert },                       /* O */
13868 +  { ISFUNC, rl_insert },                       /* P */
13869 +  { ISFUNC, rl_insert },                       /* Q */
13870 +  { ISFUNC, rl_insert },                       /* R */
13871 +  { ISFUNC, rl_insert },                       /* S */
13872 +  { ISFUNC, rl_insert },                       /* T */
13873 +  { ISFUNC, rl_insert },                       /* U */
13874 +  { ISFUNC, rl_insert },                       /* V */
13875 +  { ISFUNC, rl_insert },                       /* W */
13876 +  { ISFUNC, rl_insert },                       /* X */
13877 +  { ISFUNC, rl_insert },                       /* Y */
13878 +  { ISFUNC, rl_insert },                       /* Z */
13880    /* Some more punctuation. */
13881 -  { ISFUNC, rl_insert },               /* [ */
13882 -  { ISFUNC, rl_insert },               /* \ */
13883 -  { ISFUNC, rl_insert },               /* ] */
13884 -  { ISFUNC, rl_insert },               /* ^ */
13885 -  { ISFUNC, rl_insert },               /* _ */
13886 -  { ISFUNC, rl_insert },               /* ` */
13887 +  { ISFUNC, rl_insert },                       /* [ */
13888 +  { ISFUNC, rl_insert },                       /* \ */
13889 +  { ISFUNC, rl_insert },                       /* ] */
13890 +  { ISFUNC, rl_insert },                       /* ^ */
13891 +  { ISFUNC, rl_insert },                       /* _ */
13892 +  { ISFUNC, rl_insert },                       /* ` */
13894    /* Lowercase alphabet. */
13895 -  { ISFUNC, rl_insert },               /* a */
13896 -  { ISFUNC, rl_insert },               /* b */
13897 -  { ISFUNC, rl_insert },               /* c */
13898 -  { ISFUNC, rl_insert },               /* d */
13899 -  { ISFUNC, rl_insert },               /* e */
13900 -  { ISFUNC, rl_insert },               /* f */
13901 -  { ISFUNC, rl_insert },               /* g */
13902 -  { ISFUNC, rl_insert },               /* h */
13903 -  { ISFUNC, rl_insert },               /* i */
13904 -  { ISFUNC, rl_insert },               /* j */
13905 -  { ISFUNC, rl_insert },               /* k */
13906 -  { ISFUNC, rl_insert },               /* l */
13907 -  { ISFUNC, rl_insert },               /* m */
13908 -  { ISFUNC, rl_insert },               /* n */
13909 -  { ISFUNC, rl_insert },               /* o */
13910 -  { ISFUNC, rl_insert },               /* p */
13911 -  { ISFUNC, rl_insert },               /* q */
13912 -  { ISFUNC, rl_insert },               /* r */
13913 -  { ISFUNC, rl_insert },               /* s */
13914 -  { ISFUNC, rl_insert },               /* t */
13915 -  { ISFUNC, rl_insert },               /* u */
13916 -  { ISFUNC, rl_insert },               /* v */
13917 -  { ISFUNC, rl_insert },               /* w */
13918 -  { ISFUNC, rl_insert },               /* x */
13919 -  { ISFUNC, rl_insert },               /* y */
13920 -  { ISFUNC, rl_insert },               /* z */
13921 +  { ISFUNC, rl_insert },                       /* a */
13922 +  { ISFUNC, rl_insert },                       /* b */
13923 +  { ISFUNC, rl_insert },                       /* c */
13924 +  { ISFUNC, rl_insert },                       /* d */
13925 +  { ISFUNC, rl_insert },                       /* e */
13926 +  { ISFUNC, rl_insert },                       /* f */
13927 +  { ISFUNC, rl_insert },                       /* g */
13928 +  { ISFUNC, rl_insert },                       /* h */
13929 +  { ISFUNC, rl_insert },                       /* i */
13930 +  { ISFUNC, rl_insert },                       /* j */
13931 +  { ISFUNC, rl_insert },                       /* k */
13932 +  { ISFUNC, rl_insert },                       /* l */
13933 +  { ISFUNC, rl_insert },                       /* m */
13934 +  { ISFUNC, rl_insert },                       /* n */
13935 +  { ISFUNC, rl_insert },                       /* o */
13936 +  { ISFUNC, rl_insert },                       /* p */
13937 +  { ISFUNC, rl_insert },                       /* q */
13938 +  { ISFUNC, rl_insert },                       /* r */
13939 +  { ISFUNC, rl_insert },                       /* s */
13940 +  { ISFUNC, rl_insert },                       /* t */
13941 +  { ISFUNC, rl_insert },                       /* u */
13942 +  { ISFUNC, rl_insert },                       /* v */
13943 +  { ISFUNC, rl_insert },                       /* w */
13944 +  { ISFUNC, rl_insert },                       /* x */
13945 +  { ISFUNC, rl_insert },                       /* y */
13946 +  { ISFUNC, rl_insert },                       /* z */
13948    /* Final punctuation. */
13949 -  { ISFUNC, rl_insert },               /* { */
13950 -  { ISFUNC, rl_insert },               /* | */
13951 -  { ISFUNC, rl_insert },               /* } */
13952 -  { ISFUNC, rl_insert },               /* ~ */
13953 -  { ISFUNC, rl_rubout },               /* RUBOUT */
13954 +  { ISFUNC, rl_insert },                       /* { */
13955 +  { ISFUNC, rl_insert },                       /* | */
13956 +  { ISFUNC, rl_insert },                       /* } */
13957 +  { ISFUNC, rl_insert },                       /* ~ */
13958 +  { ISFUNC, rl_rubout },                       /* RUBOUT */
13960  #if KEYMAP_SIZE > 128
13961    /* Pure 8-bit characters (128 - 159).
13962 @@ -598,280 +598,280 @@ KEYMAP_ENTRY_ARRAY vi_insertion_keymap =
13963  #if 0
13964  KEYMAP_ENTRY_ARRAY vi_escape_keymap = {
13965    /* The regular control keys come first. */
13966 -  { ISFUNC, (Function *)0x0 },         /* Control-@ */
13967 -  { ISFUNC, (Function *)0x0 },         /* Control-a */
13968 -  { ISFUNC, (Function *)0x0 },         /* Control-b */
13969 -  { ISFUNC, (Function *)0x0 },         /* Control-c */
13970 -  { ISFUNC, (Function *)0x0 },         /* Control-d */
13971 -  { ISFUNC, (Function *)0x0 },         /* Control-e */
13972 -  { ISFUNC, (Function *)0x0 },         /* Control-f */
13973 -  { ISFUNC, (Function *)0x0 },         /* Control-g */
13974 -  { ISFUNC, (Function *)0x0 },         /* Control-h */
13975 -  { ISFUNC, rl_tab_insert},            /* Control-i */
13976 -  { ISFUNC, rl_emacs_editing_mode},    /* Control-j */
13977 -  { ISFUNC, rl_kill_line },            /* Control-k */
13978 -  { ISFUNC, (Function *)0x0 },         /* Control-l */
13979 -  { ISFUNC, rl_emacs_editing_mode},    /* Control-m */
13980 -  { ISFUNC, (Function *)0x0 },         /* Control-n */
13981 -  { ISFUNC, (Function *)0x0 },         /* Control-o */
13982 -  { ISFUNC, (Function *)0x0 },         /* Control-p */
13983 -  { ISFUNC, (Function *)0x0 },         /* Control-q */
13984 -  { ISFUNC, (Function *)0x0 },         /* Control-r */
13985 -  { ISFUNC, (Function *)0x0 },         /* Control-s */
13986 -  { ISFUNC, (Function *)0x0 },         /* Control-t */
13987 -  { ISFUNC, (Function *)0x0 },         /* Control-u */
13988 -  { ISFUNC, (Function *)0x0 },         /* Control-v */
13989 -  { ISFUNC, (Function *)0x0 },         /* Control-w */
13990 -  { ISFUNC, (Function *)0x0 },         /* Control-x */
13991 -  { ISFUNC, (Function *)0x0 },         /* Control-y */
13992 -  { ISFUNC, (Function *)0x0 },         /* Control-z */
13994 -  { ISFUNC, rl_vi_movement_mode },     /* Control-[ */
13995 -  { ISFUNC, (Function *)0x0 },         /* Control-\ */
13996 -  { ISFUNC, (Function *)0x0 },         /* Control-] */
13997 -  { ISFUNC, (Function *)0x0 },         /* Control-^ */
13998 -  { ISFUNC, rl_vi_undo },              /* Control-_ */
13999 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-@ */
14000 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-a */
14001 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-b */
14002 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-c */
14003 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-d */
14004 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-e */
14005 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-f */
14006 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-g */
14007 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-h */
14008 +  { ISFUNC, rl_tab_insert},                    /* Control-i */
14009 +  { ISFUNC, rl_emacs_editing_mode},            /* Control-j */
14010 +  { ISFUNC, rl_kill_line },                    /* Control-k */
14011 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-l */
14012 +  { ISFUNC, rl_emacs_editing_mode},            /* Control-m */
14013 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-n */
14014 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-o */
14015 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-p */
14016 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-q */
14017 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-r */
14018 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-s */
14019 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-t */
14020 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-u */
14021 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-v */
14022 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-w */
14023 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-x */
14024 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-y */
14025 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-z */
14027 +  { ISFUNC, rl_vi_movement_mode },             /* Control-[ */
14028 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-\ */
14029 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-] */
14030 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* Control-^ */
14031 +  { ISFUNC, rl_vi_undo },                      /* Control-_ */
14033    /* The start of printing characters. */
14034 -  { ISFUNC, (Function *)0x0 },         /* SPACE */
14035 -  { ISFUNC, (Function *)0x0 },         /* ! */
14036 -  { ISFUNC, (Function *)0x0 },         /* " */
14037 -  { ISFUNC, (Function *)0x0 },         /* # */
14038 -  { ISFUNC, (Function *)0x0 },         /* $ */
14039 -  { ISFUNC, (Function *)0x0 },         /* % */
14040 -  { ISFUNC, (Function *)0x0 },         /* & */
14041 -  { ISFUNC, (Function *)0x0 },         /* ' */
14042 -  { ISFUNC, (Function *)0x0 },         /* ( */
14043 -  { ISFUNC, (Function *)0x0 },         /* ) */
14044 -  { ISFUNC, (Function *)0x0 },         /* * */
14045 -  { ISFUNC, (Function *)0x0 },         /* + */
14046 -  { ISFUNC, (Function *)0x0 },         /* , */
14047 -  { ISFUNC, (Function *)0x0 },         /* - */
14048 -  { ISFUNC, (Function *)0x0 },         /* . */
14049 -  { ISFUNC, (Function *)0x0 },         /* / */
14050 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* SPACE */
14051 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ! */
14052 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* " */
14053 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* # */
14054 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* $ */
14055 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* % */
14056 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* & */
14057 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ' */
14058 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ( */
14059 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ) */
14060 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* * */
14061 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* + */
14062 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* , */
14063 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* - */
14064 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* . */
14065 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* / */
14067    /* Regular digits. */
14068 -  { ISFUNC, rl_vi_arg_digit },         /* 0 */
14069 -  { ISFUNC, rl_vi_arg_digit },         /* 1 */
14070 -  { ISFUNC, rl_vi_arg_digit },         /* 2 */
14071 -  { ISFUNC, rl_vi_arg_digit },         /* 3 */
14072 -  { ISFUNC, rl_vi_arg_digit },         /* 4 */
14073 -  { ISFUNC, rl_vi_arg_digit },         /* 5 */
14074 -  { ISFUNC, rl_vi_arg_digit },         /* 6 */
14075 -  { ISFUNC, rl_vi_arg_digit },         /* 7 */
14076 -  { ISFUNC, rl_vi_arg_digit },         /* 8 */
14077 -  { ISFUNC, rl_vi_arg_digit },         /* 9 */
14078 +  { ISFUNC, rl_vi_arg_digit },                 /* 0 */
14079 +  { ISFUNC, rl_vi_arg_digit },                 /* 1 */
14080 +  { ISFUNC, rl_vi_arg_digit },                 /* 2 */
14081 +  { ISFUNC, rl_vi_arg_digit },                 /* 3 */
14082 +  { ISFUNC, rl_vi_arg_digit },                 /* 4 */
14083 +  { ISFUNC, rl_vi_arg_digit },                 /* 5 */
14084 +  { ISFUNC, rl_vi_arg_digit },                 /* 6 */
14085 +  { ISFUNC, rl_vi_arg_digit },                 /* 7 */
14086 +  { ISFUNC, rl_vi_arg_digit },                 /* 8 */
14087 +  { ISFUNC, rl_vi_arg_digit },                 /* 9 */
14089    /* A little more punctuation. */
14090 -  { ISFUNC, (Function *)0x0 },         /* : */
14091 -  { ISFUNC, (Function *)0x0 },         /* ; */
14092 -  { ISFUNC, (Function *)0x0 },         /* < */
14093 -  { ISFUNC, (Function *)0x0 },         /* = */
14094 -  { ISFUNC, (Function *)0x0 },         /* > */
14095 -  { ISFUNC, (Function *)0x0 },         /* ? */
14096 -  { ISFUNC, (Function *)0x0 },         /* @ */
14097 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* : */
14098 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ; */
14099 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* < */
14100 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* = */
14101 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* > */
14102 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ? */
14103 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* @ */
14105    /* Uppercase alphabet. */
14106 -  { ISFUNC, rl_do_lowercase_version }, /* A */
14107 -  { ISFUNC, rl_do_lowercase_version }, /* B */
14108 -  { ISFUNC, rl_do_lowercase_version }, /* C */
14109 -  { ISFUNC, rl_do_lowercase_version }, /* D */
14110 -  { ISFUNC, rl_do_lowercase_version }, /* E */
14111 -  { ISFUNC, rl_do_lowercase_version }, /* F */
14112 -  { ISFUNC, rl_do_lowercase_version }, /* G */
14113 -  { ISFUNC, rl_do_lowercase_version }, /* H */
14114 -  { ISFUNC, rl_do_lowercase_version }, /* I */
14115 -  { ISFUNC, rl_do_lowercase_version }, /* J */
14116 -  { ISFUNC, rl_do_lowercase_version }, /* K */
14117 -  { ISFUNC, rl_do_lowercase_version }, /* L */
14118 -  { ISFUNC, rl_do_lowercase_version }, /* M */
14119 -  { ISFUNC, rl_do_lowercase_version }, /* N */
14120 -  { ISFUNC, rl_do_lowercase_version }, /* O */
14121 -  { ISFUNC, rl_do_lowercase_version }, /* P */
14122 -  { ISFUNC, rl_do_lowercase_version }, /* Q */
14123 -  { ISFUNC, rl_do_lowercase_version }, /* R */
14124 -  { ISFUNC, rl_do_lowercase_version }, /* S */
14125 -  { ISFUNC, rl_do_lowercase_version }, /* T */
14126 -  { ISFUNC, rl_do_lowercase_version }, /* U */
14127 -  { ISFUNC, rl_do_lowercase_version }, /* V */
14128 -  { ISFUNC, rl_do_lowercase_version }, /* W */
14129 -  { ISFUNC, rl_do_lowercase_version }, /* X */
14130 -  { ISFUNC, rl_do_lowercase_version }, /* Y */
14131 -  { ISFUNC, rl_do_lowercase_version }, /* Z */
14132 +  { ISFUNC, rl_do_lowercase_version },         /* A */
14133 +  { ISFUNC, rl_do_lowercase_version },         /* B */
14134 +  { ISFUNC, rl_do_lowercase_version },         /* C */
14135 +  { ISFUNC, rl_do_lowercase_version },         /* D */
14136 +  { ISFUNC, rl_do_lowercase_version },         /* E */
14137 +  { ISFUNC, rl_do_lowercase_version },         /* F */
14138 +  { ISFUNC, rl_do_lowercase_version },         /* G */
14139 +  { ISFUNC, rl_do_lowercase_version },         /* H */
14140 +  { ISFUNC, rl_do_lowercase_version },         /* I */
14141 +  { ISFUNC, rl_do_lowercase_version },         /* J */
14142 +  { ISFUNC, rl_do_lowercase_version },         /* K */
14143 +  { ISFUNC, rl_do_lowercase_version },         /* L */
14144 +  { ISFUNC, rl_do_lowercase_version },         /* M */
14145 +  { ISFUNC, rl_do_lowercase_version },         /* N */
14146 +  { ISFUNC, rl_do_lowercase_version },         /* O */
14147 +  { ISFUNC, rl_do_lowercase_version },         /* P */
14148 +  { ISFUNC, rl_do_lowercase_version },         /* Q */
14149 +  { ISFUNC, rl_do_lowercase_version },         /* R */
14150 +  { ISFUNC, rl_do_lowercase_version },         /* S */
14151 +  { ISFUNC, rl_do_lowercase_version },         /* T */
14152 +  { ISFUNC, rl_do_lowercase_version },         /* U */
14153 +  { ISFUNC, rl_do_lowercase_version },         /* V */
14154 +  { ISFUNC, rl_do_lowercase_version },         /* W */
14155 +  { ISFUNC, rl_do_lowercase_version },         /* X */
14156 +  { ISFUNC, rl_do_lowercase_version },         /* Y */
14157 +  { ISFUNC, rl_do_lowercase_version },         /* Z */
14159    /* Some more punctuation. */
14160 -  { ISFUNC, rl_arrow_keys },           /* [ */
14161 -  { ISFUNC, (Function *)0x0 },         /* \ */
14162 -  { ISFUNC, (Function *)0x0 },         /* ] */
14163 -  { ISFUNC, (Function *)0x0 },         /* ^ */
14164 -  { ISFUNC, (Function *)0x0 },         /* _ */
14165 -  { ISFUNC, (Function *)0x0 },         /* ` */
14166 +  { ISFUNC, rl_arrow_keys },                   /* [ */
14167 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* \ */
14168 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ] */
14169 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ^ */
14170 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* _ */
14171 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ` */
14173    /* Lowercase alphabet. */
14174 -  { ISFUNC, (Function *)0x0 },         /* a */
14175 -  { ISFUNC, (Function *)0x0 },         /* b */
14176 -  { ISFUNC, (Function *)0x0 },         /* c */
14177 -  { ISFUNC, (Function *)0x0 },         /* d */
14178 -  { ISFUNC, (Function *)0x0 },         /* e */
14179 -  { ISFUNC, (Function *)0x0 },         /* f */
14180 -  { ISFUNC, (Function *)0x0 },         /* g */
14181 -  { ISFUNC, (Function *)0x0 },         /* h */
14182 -  { ISFUNC, (Function *)0x0 },         /* i */
14183 -  { ISFUNC, (Function *)0x0 },         /* j */
14184 -  { ISFUNC, (Function *)0x0 },         /* k */
14185 -  { ISFUNC, (Function *)0x0 },         /* l */
14186 -  { ISFUNC, (Function *)0x0 },         /* m */
14187 -  { ISFUNC, (Function *)0x0 },         /* n */
14188 -  { ISFUNC, rl_arrow_keys },           /* o */
14189 -  { ISFUNC, (Function *)0x0 },         /* p */
14190 -  { ISFUNC, (Function *)0x0 },         /* q */
14191 -  { ISFUNC, (Function *)0x0 },         /* r */
14192 -  { ISFUNC, (Function *)0x0 },         /* s */
14193 -  { ISFUNC, (Function *)0x0 },         /* t */
14194 -  { ISFUNC, (Function *)0x0 },         /* u */
14195 -  { ISFUNC, (Function *)0x0 },         /* v */
14196 -  { ISFUNC, (Function *)0x0 },         /* w */
14197 -  { ISFUNC, (Function *)0x0 },         /* x */
14198 -  { ISFUNC, (Function *)0x0 },         /* y */
14199 -  { ISFUNC, (Function *)0x0 },         /* z */
14200 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* a */
14201 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* b */
14202 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* c */
14203 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* d */
14204 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* e */
14205 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* f */
14206 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* g */
14207 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* h */
14208 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* i */
14209 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* j */
14210 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* k */
14211 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* l */
14212 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* m */
14213 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* n */
14214 +  { ISFUNC, rl_arrow_keys },                   /* o */
14215 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* p */
14216 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* q */
14217 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* r */
14218 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* s */
14219 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* t */
14220 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* u */
14221 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* v */
14222 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* w */
14223 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* x */
14224 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* y */
14225 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* z */
14227    /* Final punctuation. */
14228 -  { ISFUNC, (Function *)0x0 },         /* { */
14229 -  { ISFUNC, (Function *)0x0 },         /* | */
14230 -  { ISFUNC, (Function *)0x0 },         /* } */
14231 -  { ISFUNC, (Function *)0x0 },         /* ~ */
14232 -  { ISFUNC, rl_backward_kill_word },   /* RUBOUT */
14233 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* { */
14234 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* | */
14235 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* } */
14236 +  { ISFUNC, (rl_command_func_t *)0x0 },                /* ~ */
14237 +  { ISFUNC, rl_backward_kill_word },           /* RUBOUT */
14239  #if KEYMAP_SIZE > 128
14240    /* Undefined keys. */
14241 -  { ISFUNC, (Function *)0x0 },
14242 -  { ISFUNC, (Function *)0x0 },
14243 -  { ISFUNC, (Function *)0x0 },
14244 -  { ISFUNC, (Function *)0x0 },
14245 -  { ISFUNC, (Function *)0x0 },
14246 -  { ISFUNC, (Function *)0x0 },
14247 -  { ISFUNC, (Function *)0x0 },
14248 -  { ISFUNC, (Function *)0x0 },
14249 -  { ISFUNC, (Function *)0x0 },
14250 -  { ISFUNC, (Function *)0x0 },
14251 -  { ISFUNC, (Function *)0x0 },
14252 -  { ISFUNC, (Function *)0x0 },
14253 -  { ISFUNC, (Function *)0x0 },
14254 -  { ISFUNC, (Function *)0x0 },
14255 -  { ISFUNC, (Function *)0x0 },
14256 -  { ISFUNC, (Function *)0x0 },
14257 -  { ISFUNC, (Function *)0x0 },
14258 -  { ISFUNC, (Function *)0x0 },
14259 -  { ISFUNC, (Function *)0x0 },
14260 -  { ISFUNC, (Function *)0x0 },
14261 -  { ISFUNC, (Function *)0x0 },
14262 -  { ISFUNC, (Function *)0x0 },
14263 -  { ISFUNC, (Function *)0x0 },
14264 -  { ISFUNC, (Function *)0x0 },
14265 -  { ISFUNC, (Function *)0x0 },
14266 -  { ISFUNC, (Function *)0x0 },
14267 -  { ISFUNC, (Function *)0x0 },
14268 -  { ISFUNC, (Function *)0x0 },
14269 -  { ISFUNC, (Function *)0x0 },
14270 -  { ISFUNC, (Function *)0x0 },
14271 -  { ISFUNC, (Function *)0x0 },
14272 -  { ISFUNC, (Function *)0x0 },
14273 -  { ISFUNC, (Function *)0x0 },
14274 -  { ISFUNC, (Function *)0x0 },
14275 -  { ISFUNC, (Function *)0x0 },
14276 -  { ISFUNC, (Function *)0x0 },
14277 -  { ISFUNC, (Function *)0x0 },
14278 -  { ISFUNC, (Function *)0x0 },
14279 -  { ISFUNC, (Function *)0x0 },
14280 -  { ISFUNC, (Function *)0x0 },
14281 -  { ISFUNC, (Function *)0x0 },
14282 -  { ISFUNC, (Function *)0x0 },
14283 -  { ISFUNC, (Function *)0x0 },
14284 -  { ISFUNC, (Function *)0x0 },
14285 -  { ISFUNC, (Function *)0x0 },
14286 -  { ISFUNC, (Function *)0x0 },
14287 -  { ISFUNC, (Function *)0x0 },
14288 -  { ISFUNC, (Function *)0x0 },
14289 -  { ISFUNC, (Function *)0x0 },
14290 -  { ISFUNC, (Function *)0x0 },
14291 -  { ISFUNC, (Function *)0x0 },
14292 -  { ISFUNC, (Function *)0x0 },
14293 -  { ISFUNC, (Function *)0x0 },
14294 -  { ISFUNC, (Function *)0x0 },
14295 -  { ISFUNC, (Function *)0x0 },
14296 -  { ISFUNC, (Function *)0x0 },
14297 -  { ISFUNC, (Function *)0x0 },
14298 -  { ISFUNC, (Function *)0x0 },
14299 -  { ISFUNC, (Function *)0x0 },
14300 -  { ISFUNC, (Function *)0x0 },
14301 -  { ISFUNC, (Function *)0x0 },
14302 -  { ISFUNC, (Function *)0x0 },
14303 -  { ISFUNC, (Function *)0x0 },
14304 -  { ISFUNC, (Function *)0x0 },
14305 -  { ISFUNC, (Function *)0x0 },
14306 -  { ISFUNC, (Function *)0x0 },
14307 -  { ISFUNC, (Function *)0x0 },
14308 -  { ISFUNC, (Function *)0x0 },
14309 -  { ISFUNC, (Function *)0x0 },
14310 -  { ISFUNC, (Function *)0x0 },
14311 -  { ISFUNC, (Function *)0x0 },
14312 -  { ISFUNC, (Function *)0x0 },
14313 -  { ISFUNC, (Function *)0x0 },
14314 -  { ISFUNC, (Function *)0x0 },
14315 -  { ISFUNC, (Function *)0x0 },
14316 -  { ISFUNC, (Function *)0x0 },
14317 -  { ISFUNC, (Function *)0x0 },
14318 -  { ISFUNC, (Function *)0x0 },
14319 -  { ISFUNC, (Function *)0x0 },
14320 -  { ISFUNC, (Function *)0x0 },
14321 -  { ISFUNC, (Function *)0x0 },
14322 -  { ISFUNC, (Function *)0x0 },
14323 -  { ISFUNC, (Function *)0x0 },
14324 -  { ISFUNC, (Function *)0x0 },
14325 -  { ISFUNC, (Function *)0x0 },
14326 -  { ISFUNC, (Function *)0x0 },
14327 -  { ISFUNC, (Function *)0x0 },
14328 -  { ISFUNC, (Function *)0x0 },
14329 -  { ISFUNC, (Function *)0x0 },
14330 -  { ISFUNC, (Function *)0x0 },
14331 -  { ISFUNC, (Function *)0x0 },
14332 -  { ISFUNC, (Function *)0x0 },
14333 -  { ISFUNC, (Function *)0x0 },
14334 -  { ISFUNC, (Function *)0x0 },
14335 -  { ISFUNC, (Function *)0x0 },
14336 -  { ISFUNC, (Function *)0x0 },
14337 -  { ISFUNC, (Function *)0x0 },
14338 -  { ISFUNC, (Function *)0x0 },
14339 -  { ISFUNC, (Function *)0x0 },
14340 -  { ISFUNC, (Function *)0x0 },
14341 -  { ISFUNC, (Function *)0x0 },
14342 -  { ISFUNC, (Function *)0x0 },
14343 -  { ISFUNC, (Function *)0x0 },
14344 -  { ISFUNC, (Function *)0x0 },
14345 -  { ISFUNC, (Function *)0x0 },
14346 -  { ISFUNC, (Function *)0x0 },
14347 -  { ISFUNC, (Function *)0x0 },
14348 -  { ISFUNC, (Function *)0x0 },
14349 -  { ISFUNC, (Function *)0x0 },
14350 -  { ISFUNC, (Function *)0x0 },
14351 -  { ISFUNC, (Function *)0x0 },
14352 -  { ISFUNC, (Function *)0x0 },
14353 -  { ISFUNC, (Function *)0x0 },
14354 -  { ISFUNC, (Function *)0x0 },
14355 -  { ISFUNC, (Function *)0x0 },
14356 -  { ISFUNC, (Function *)0x0 },
14357 -  { ISFUNC, (Function *)0x0 },
14358 -  { ISFUNC, (Function *)0x0 },
14359 -  { ISFUNC, (Function *)0x0 },
14360 -  { ISFUNC, (Function *)0x0 },
14361 -  { ISFUNC, (Function *)0x0 },
14362 -  { ISFUNC, (Function *)0x0 },
14363 -  { ISFUNC, (Function *)0x0 },
14364 -  { ISFUNC, (Function *)0x0 },
14365 -  { ISFUNC, (Function *)0x0 },
14366 -  { ISFUNC, (Function *)0x0 },
14367 -  { ISFUNC, (Function *)0x0 },
14368 -  { ISFUNC, (Function *)0x0 }
14369 +  { ISFUNC, (rl_command_func_t *)0x0 },
14370 +  { ISFUNC, (rl_command_func_t *)0x0 },
14371 +  { ISFUNC, (rl_command_func_t *)0x0 },
14372 +  { ISFUNC, (rl_command_func_t *)0x0 },
14373 +  { ISFUNC, (rl_command_func_t *)0x0 },
14374 +  { ISFUNC, (rl_command_func_t *)0x0 },
14375 +  { ISFUNC, (rl_command_func_t *)0x0 },
14376 +  { ISFUNC, (rl_command_func_t *)0x0 },
14377 +  { ISFUNC, (rl_command_func_t *)0x0 },
14378 +  { ISFUNC, (rl_command_func_t *)0x0 },
14379 +  { ISFUNC, (rl_command_func_t *)0x0 },
14380 +  { ISFUNC, (rl_command_func_t *)0x0 },
14381 +  { ISFUNC, (rl_command_func_t *)0x0 },
14382 +  { ISFUNC, (rl_command_func_t *)0x0 },
14383 +  { ISFUNC, (rl_command_func_t *)0x0 },
14384 +  { ISFUNC, (rl_command_func_t *)0x0 },
14385 +  { ISFUNC, (rl_command_func_t *)0x0 },
14386 +  { ISFUNC, (rl_command_func_t *)0x0 },
14387 +  { ISFUNC, (rl_command_func_t *)0x0 },
14388 +  { ISFUNC, (rl_command_func_t *)0x0 },
14389 +  { ISFUNC, (rl_command_func_t *)0x0 },
14390 +  { ISFUNC, (rl_command_func_t *)0x0 },
14391 +  { ISFUNC, (rl_command_func_t *)0x0 },
14392 +  { ISFUNC, (rl_command_func_t *)0x0 },
14393 +  { ISFUNC, (rl_command_func_t *)0x0 },
14394 +  { ISFUNC, (rl_command_func_t *)0x0 },
14395 +  { ISFUNC, (rl_command_func_t *)0x0 },
14396 +  { ISFUNC, (rl_command_func_t *)0x0 },
14397 +  { ISFUNC, (rl_command_func_t *)0x0 },
14398 +  { ISFUNC, (rl_command_func_t *)0x0 },
14399 +  { ISFUNC, (rl_command_func_t *)0x0 },
14400 +  { ISFUNC, (rl_command_func_t *)0x0 },
14401 +  { ISFUNC, (rl_command_func_t *)0x0 },
14402 +  { ISFUNC, (rl_command_func_t *)0x0 },
14403 +  { ISFUNC, (rl_command_func_t *)0x0 },
14404 +  { ISFUNC, (rl_command_func_t *)0x0 },
14405 +  { ISFUNC, (rl_command_func_t *)0x0 },
14406 +  { ISFUNC, (rl_command_func_t *)0x0 },
14407 +  { ISFUNC, (rl_command_func_t *)0x0 },
14408 +  { ISFUNC, (rl_command_func_t *)0x0 },
14409 +  { ISFUNC, (rl_command_func_t *)0x0 },
14410 +  { ISFUNC, (rl_command_func_t *)0x0 },
14411 +  { ISFUNC, (rl_command_func_t *)0x0 },
14412 +  { ISFUNC, (rl_command_func_t *)0x0 },
14413 +  { ISFUNC, (rl_command_func_t *)0x0 },
14414 +  { ISFUNC, (rl_command_func_t *)0x0 },
14415 +  { ISFUNC, (rl_command_func_t *)0x0 },
14416 +  { ISFUNC, (rl_command_func_t *)0x0 },
14417 +  { ISFUNC, (rl_command_func_t *)0x0 },
14418 +  { ISFUNC, (rl_command_func_t *)0x0 },
14419 +  { ISFUNC, (rl_command_func_t *)0x0 },
14420 +  { ISFUNC, (rl_command_func_t *)0x0 },
14421 +  { ISFUNC, (rl_command_func_t *)0x0 },
14422 +  { ISFUNC, (rl_command_func_t *)0x0 },
14423 +  { ISFUNC, (rl_command_func_t *)0x0 },
14424 +  { ISFUNC, (rl_command_func_t *)0x0 },
14425 +  { ISFUNC, (rl_command_func_t *)0x0 },
14426 +  { ISFUNC, (rl_command_func_t *)0x0 },
14427 +  { ISFUNC, (rl_command_func_t *)0x0 },
14428 +  { ISFUNC, (rl_command_func_t *)0x0 },
14429 +  { ISFUNC, (rl_command_func_t *)0x0 },
14430 +  { ISFUNC, (rl_command_func_t *)0x0 },
14431 +  { ISFUNC, (rl_command_func_t *)0x0 },
14432 +  { ISFUNC, (rl_command_func_t *)0x0 },
14433 +  { ISFUNC, (rl_command_func_t *)0x0 },
14434 +  { ISFUNC, (rl_command_func_t *)0x0 },
14435 +  { ISFUNC, (rl_command_func_t *)0x0 },
14436 +  { ISFUNC, (rl_command_func_t *)0x0 },
14437 +  { ISFUNC, (rl_command_func_t *)0x0 },
14438 +  { ISFUNC, (rl_command_func_t *)0x0 },
14439 +  { ISFUNC, (rl_command_func_t *)0x0 },
14440 +  { ISFUNC, (rl_command_func_t *)0x0 },
14441 +  { ISFUNC, (rl_command_func_t *)0x0 },
14442 +  { ISFUNC, (rl_command_func_t *)0x0 },
14443 +  { ISFUNC, (rl_command_func_t *)0x0 },
14444 +  { ISFUNC, (rl_command_func_t *)0x0 },
14445 +  { ISFUNC, (rl_command_func_t *)0x0 },
14446 +  { ISFUNC, (rl_command_func_t *)0x0 },
14447 +  { ISFUNC, (rl_command_func_t *)0x0 },
14448 +  { ISFUNC, (rl_command_func_t *)0x0 },
14449 +  { ISFUNC, (rl_command_func_t *)0x0 },
14450 +  { ISFUNC, (rl_command_func_t *)0x0 },
14451 +  { ISFUNC, (rl_command_func_t *)0x0 },
14452 +  { ISFUNC, (rl_command_func_t *)0x0 },
14453 +  { ISFUNC, (rl_command_func_t *)0x0 },
14454 +  { ISFUNC, (rl_command_func_t *)0x0 },
14455 +  { ISFUNC, (rl_command_func_t *)0x0 },
14456 +  { ISFUNC, (rl_command_func_t *)0x0 },
14457 +  { ISFUNC, (rl_command_func_t *)0x0 },
14458 +  { ISFUNC, (rl_command_func_t *)0x0 },
14459 +  { ISFUNC, (rl_command_func_t *)0x0 },
14460 +  { ISFUNC, (rl_command_func_t *)0x0 },
14461 +  { ISFUNC, (rl_command_func_t *)0x0 },
14462 +  { ISFUNC, (rl_command_func_t *)0x0 },
14463 +  { ISFUNC, (rl_command_func_t *)0x0 },
14464 +  { ISFUNC, (rl_command_func_t *)0x0 },
14465 +  { ISFUNC, (rl_command_func_t *)0x0 },
14466 +  { ISFUNC, (rl_command_func_t *)0x0 },
14467 +  { ISFUNC, (rl_command_func_t *)0x0 },
14468 +  { ISFUNC, (rl_command_func_t *)0x0 },
14469 +  { ISFUNC, (rl_command_func_t *)0x0 },
14470 +  { ISFUNC, (rl_command_func_t *)0x0 },
14471 +  { ISFUNC, (rl_command_func_t *)0x0 },
14472 +  { ISFUNC, (rl_command_func_t *)0x0 },
14473 +  { ISFUNC, (rl_command_func_t *)0x0 },
14474 +  { ISFUNC, (rl_command_func_t *)0x0 },
14475 +  { ISFUNC, (rl_command_func_t *)0x0 },
14476 +  { ISFUNC, (rl_command_func_t *)0x0 },
14477 +  { ISFUNC, (rl_command_func_t *)0x0 },
14478 +  { ISFUNC, (rl_command_func_t *)0x0 },
14479 +  { ISFUNC, (rl_command_func_t *)0x0 },
14480 +  { ISFUNC, (rl_command_func_t *)0x0 },
14481 +  { ISFUNC, (rl_command_func_t *)0x0 },
14482 +  { ISFUNC, (rl_command_func_t *)0x0 },
14483 +  { ISFUNC, (rl_command_func_t *)0x0 },
14484 +  { ISFUNC, (rl_command_func_t *)0x0 },
14485 +  { ISFUNC, (rl_command_func_t *)0x0 },
14486 +  { ISFUNC, (rl_command_func_t *)0x0 },
14487 +  { ISFUNC, (rl_command_func_t *)0x0 },
14488 +  { ISFUNC, (rl_command_func_t *)0x0 },
14489 +  { ISFUNC, (rl_command_func_t *)0x0 },
14490 +  { ISFUNC, (rl_command_func_t *)0x0 },
14491 +  { ISFUNC, (rl_command_func_t *)0x0 },
14492 +  { ISFUNC, (rl_command_func_t *)0x0 },
14493 +  { ISFUNC, (rl_command_func_t *)0x0 },
14494 +  { ISFUNC, (rl_command_func_t *)0x0 },
14495 +  { ISFUNC, (rl_command_func_t *)0x0 },
14496 +  { ISFUNC, (rl_command_func_t *)0x0 }
14497  #endif /* KEYMAP_SIZE > 128 */
14498  };
14499  #endif
14500 Index: readline/vi_mode.c
14501 ===================================================================
14502 RCS file: /prjz/.cvsroot/gdb/readline/vi_mode.c,v
14503 retrieving revision 1.1.1.1
14504 diff -u -3 -p -r1.1.1.1 vi_mode.c
14505 --- readline/vi_mode.c  2003/02/16 21:36:33     1.1.1.1
14506 +++ readline/vi_mode.c  2000/11/08 16:47:02
14507 @@ -81,7 +81,7 @@
14508  static int _rl_vi_doing_insert;
14510  /* Command keys which do movement for xxx_to commands. */
14511 -static char *vi_motion = " hl^$0ftFt;,%wbeWBE|";
14512 +static const char *vi_motion = " hl^$0ftFt;,%wbeWBE|";
14514  /* Keymap used for vi replace characters.  Created dynamically since
14515     rarely used. */
14516 @@ -109,7 +109,7 @@ static int _rl_vi_last_key_before_insert
14517  static int vi_redoing;
14519  /* Text modification commands.  These are the `redoable' commands. */
14520 -static char *vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~";
14521 +static const char *vi_textmod = "_*\\AaIiCcDdPpYyRrSsXx~";
14523  /* Arrays for the saved marks. */
14524  static int vi_mark_chars[27];
14525 @@ -274,7 +274,7 @@ rl_vi_search (count, key)
14526        break;
14528      default:
14529 -      ding ();
14530 +      rl_ding ();
14531        break;
14532      }
14533    return (0);
14534 @@ -330,7 +330,7 @@ rl_vi_prev_word (count, key)
14536    if (rl_point == 0)
14537      {
14538 -      ding ();
14539 +      rl_ding ();
14540        return (0);
14541      }
14543 @@ -352,7 +352,7 @@ rl_vi_next_word (count, key)
14545    if (rl_point >= (rl_end - 1))
14546      {
14547 -      ding ();
14548 +      rl_ding ();
14549        return (0);
14550      }
14552 @@ -370,7 +370,7 @@ rl_vi_end_word (count, key)
14554    if (count < 0)
14555      {
14556 -      ding ();
14557 +      rl_ding ();
14558        return -1;
14559      }
14561 @@ -744,7 +744,9 @@ rl_vi_domove (key, nextkey)
14562    int old_end;
14564    rl_mark = rl_point;
14565 +  RL_SETSTATE(RL_STATE_MOREINPUT);
14566    c = rl_read_key ();
14567 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
14568    *nextkey = c;
14570    if (!member (c, vi_motion))
14571 @@ -755,7 +757,9 @@ rl_vi_domove (key, nextkey)
14572           rl_numeric_arg = _rl_digit_value (c);
14573           rl_digit_loop1 ();
14574           rl_numeric_arg *= save;
14575 +         RL_SETSTATE(RL_STATE_MOREINPUT);
14576           c = rl_read_key ();   /* real command */
14577 +         RL_UNSETSTATE(RL_STATE_MOREINPUT);
14578           *nextkey = c;
14579         }
14580        else if (key == c && (key == 'd' || key == 'y' || key == 'c'))
14581 @@ -825,16 +829,28 @@ rl_vi_domove (key, nextkey)
14584  /* A simplified loop for vi. Don't dispatch key at end.
14585 -   Don't recognize minus sign? */
14586 +   Don't recognize minus sign?
14587 +   Should this do rl_save_prompt/rl_restore_prompt? */
14588  static int
14589  rl_digit_loop1 ()
14591    int key, c;
14593 +  RL_SETSTATE(RL_STATE_NUMERICARG);
14594    while (1)
14595      {
14596 +      if (rl_numeric_arg > 1000000)
14597 +       {
14598 +         rl_explicit_arg = rl_numeric_arg = 0;
14599 +         rl_ding ();
14600 +         rl_clear_message ();
14601 +         RL_UNSETSTATE(RL_STATE_NUMERICARG);
14602 +         return 1;
14603 +       }
14604        rl_message ("(arg: %d) ", rl_arg_sign * rl_numeric_arg, 0);
14605 +      RL_SETSTATE(RL_STATE_MOREINPUT);
14606        key = c = rl_read_key ();
14607 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
14609        if (_rl_keymap[c].type == ISFUNC &&
14610           _rl_keymap[c].function == rl_universal_argument)
14611 @@ -859,6 +875,8 @@ rl_digit_loop1 ()
14612           break;
14613         }
14614      }
14616 +  RL_UNSETSTATE(RL_STATE_NUMERICARG);
14617    return (0);
14620 @@ -875,7 +893,7 @@ rl_vi_delete_to (count, key)
14622    if (rl_vi_domove (key, &c))
14623      {
14624 -      ding ();
14625 +      rl_ding ();
14626        return -1;
14627      }
14629 @@ -903,7 +921,7 @@ rl_vi_change_to (count, key)
14631    if (rl_vi_domove (key, &c))
14632      {
14633 -      ding ();
14634 +      rl_ding ();
14635        return -1;
14636      }
14638 @@ -953,7 +971,7 @@ rl_vi_yank_to (count, key)
14640    if (rl_vi_domove (key, &c))
14641      {
14642 -      ding ();
14643 +      rl_ding ();
14644        return -1;
14645      }
14647 @@ -979,7 +997,7 @@ rl_vi_delete (count, key)
14649    if (rl_end == 0)
14650      {
14651 -      ding ();
14652 +      rl_ding ();
14653        return -1;
14654      }
14656 @@ -1026,7 +1044,11 @@ rl_vi_char_search (count, key)
14657        if (vi_redoing)
14658         target = _rl_vi_last_search_char;
14659        else
14660 -       _rl_vi_last_search_char = target = (*rl_getc_function) (rl_instream);
14661 +       {
14662 +         RL_SETSTATE(RL_STATE_MOREINPUT);
14663 +         _rl_vi_last_search_char = target = rl_read_key ();
14664 +         RL_UNSETSTATE(RL_STATE_MOREINPUT);
14665 +       }
14667        switch (key)
14668          {
14669 @@ -1068,7 +1090,7 @@ rl_vi_match (ignore, key)
14670        if (brack <= 0)
14671         {
14672           rl_point = pos;
14673 -         ding ();
14674 +         rl_ding ();
14675           return -1;
14676         }
14677      }
14678 @@ -1089,7 +1111,7 @@ rl_vi_match (ignore, key)
14679             }
14680           else
14681             {
14682 -             ding ();
14683 +             rl_ding ();
14684               return -1;
14685             }
14686         }
14687 @@ -1108,7 +1130,7 @@ rl_vi_match (ignore, key)
14688             }
14689           else
14690             {
14691 -             ding ();
14692 +             rl_ding ();
14693               return -1;
14694             }
14695         }
14696 @@ -1142,7 +1164,11 @@ rl_vi_change_char (count, key)
14697    if (vi_redoing)
14698      c = _rl_vi_last_replacement;
14699    else
14700 -    _rl_vi_last_replacement = c = (*rl_getc_function) (rl_instream);
14701 +    {
14702 +      RL_SETSTATE(RL_STATE_MOREINPUT);
14703 +      _rl_vi_last_replacement = c = rl_read_key ();
14704 +      RL_UNSETSTATE(RL_STATE_MOREINPUT);
14705 +    }
14707    if (c == '\033' || c == CTRL ('C'))
14708      return -1;
14709 @@ -1238,7 +1264,7 @@ rl_vi_overstrike_delete (count, key)
14710      {
14711        if (vi_replace_count == 0)
14712         {
14713 -         ding ();
14714 +         rl_ding ();
14715           break;
14716         }
14717        s = rl_point;
14718 @@ -1308,7 +1334,7 @@ rl_vi_possible_completions()
14719      }
14720    else if (rl_line_buffer[rl_point - 1] == ';')
14721      {
14722 -      ding ();
14723 +      rl_ding ();
14724        return (0);
14725      }
14727 @@ -1326,10 +1352,13 @@ rl_vi_set_mark (count, key)
14729    int ch;
14731 +  RL_SETSTATE(RL_STATE_MOREINPUT);
14732    ch = rl_read_key ();
14733 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
14735    if (_rl_lowercase_p (ch) == 0)
14736      {
14737 -      ding ();
14738 +      rl_ding ();
14739        return -1;
14740      }
14741    ch -= 'a';
14742 @@ -1343,7 +1372,10 @@ rl_vi_goto_mark (count, key)
14744    int ch;
14746 +  RL_SETSTATE(RL_STATE_MOREINPUT);
14747    ch = rl_read_key ();
14748 +  RL_UNSETSTATE(RL_STATE_MOREINPUT);
14750    if (ch == '`')
14751      {
14752        rl_point = rl_mark;
14753 @@ -1351,14 +1383,14 @@ rl_vi_goto_mark (count, key)
14754      }
14755    else if (_rl_lowercase_p (ch) == 0)
14756      {
14757 -      ding ();
14758 +      rl_ding ();
14759        return -1;
14760      }
14762    ch -= 'a';
14763    if (vi_mark_chars[ch] == -1)
14764      {
14765 -      ding ();
14766 +      rl_ding ();
14767        return -1;
14768      }
14769    rl_point = vi_mark_chars[ch];
14770 Index: readline/doc/Makefile.in
14771 ===================================================================
14772 RCS file: /prjz/.cvsroot/gdb/readline/doc/Makefile.in,v
14773 retrieving revision 1.1.1.1
14774 diff -u -3 -p -r1.1.1.1 Makefile.in
14775 --- readline/doc/Makefile.in    2003/02/16 21:36:33     1.1.1.1
14776 +++ readline/doc/Makefile.in    2001/03/06 14:05:46
14777 @@ -63,13 +63,13 @@ GROFF       = groff
14779  DVIOBJ = readline.dvi history.dvi rluserman.dvi
14780  INFOOBJ = readline.info history.info rluserman.info
14781 -PSOBJ = readline.ps history.ps rluserman.ps
14782 +PSOBJ = readline.ps history.ps rluserman.ps readline_3.ps history_3.ps
14783  HTMLOBJ = readline.html history.html rluserman.html
14784 -TEXTOBJ = readline.0
14785 +TEXTOBJ = readline.0 history.0
14787  INTERMEDIATE_OBJ = rlman.dvi hist.dvi rluserman.dvi
14789 -CREATED_DOCS = $(DVIOBJ) $(INFOOBJ) $(PSOBJ) $(HTMLOBJ) $(TEXTOBJ)
14790 +DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ)
14792  .SUFFIXES:      .0 .3 .ps .txt .dvi
14794 @@ -133,19 +133,28 @@ text:     $(TEXTOBJ)
14796  readline.0: readline.3
14798 +readline_3.ps: readline.3
14799 +       ${RM} $@
14800 +       ${GROFF} -man < $(srcdir)/readline.3 > $@ 
14802 +history.0: history.3
14804 +history_3.ps: history.3
14805 +       ${RM} $@
14806 +       ${GROFF} -man < $(srcdir)/history.3 > $@ 
14808  clean:
14809         $(RM) *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps *.pgs \
14810               *.fns *.kys *.tps *.vrs *.bt *.bts *.o core
14812  distclean: clean
14813 -       $(RM) $(CREATED_DOCS)
14814         $(RM) $(INTERMEDIATE_OBJ)
14815         $(RM) Makefile
14817  mostlyclean: clean
14819  maintainer-clean: clean
14820 -       $(RM) $(CREATED_DOCS)
14821 +       $(RM) $(DIST_DOCS)
14822         $(RM) $(INTERMEDIATE_OBJ)
14823         $(RM) Makefile
14825 @@ -173,9 +182,11 @@ install:   installdirs
14826                 install-info --dir-file=$(infodir)/dir $(infodir)/history.info ; \
14827         else true; fi
14828         -${INSTALL_DATA} $(srcdir)/readline.3 $(man3dir)/readline.3
14829 +       -${INSTALL_DATA} $(srcdir)/history.3 $(man3dir)/history.3
14831  uninstall:
14832         $(RM) $(infodir)/readline.info
14833         $(RM) $(infodir)/rluserman.info
14834         $(RM) $(infodir)/history.info
14835         $(RM) $(man3dir)/readline.3
14836 +       $(RM) $(man3dir)/history.3
14837 Index: readline/doc/hist.texinfo
14838 ===================================================================
14839 RCS file: /prjz/.cvsroot/gdb/readline/doc/hist.texinfo,v
14840 retrieving revision 1.1.1.1
14841 diff -u -3 -p -r1.1.1.1 hist.texinfo
14842 --- readline/doc/hist.texinfo   2003/02/16 21:36:33     1.1.1.1
14843 +++ readline/doc/hist.texinfo   2001/02/02 16:37:12
14844 @@ -18,7 +18,7 @@ This document describes the GNU History 
14845  provides a consistent user interface for recalling lines of previously
14846  typed input.
14848 -Copyright (C) 1988-1999 Free Software Foundation, Inc.
14849 +Copyright (C) 1988-2001 Free Software Foundation, Inc.
14851  Permission is granted to make and distribute verbatim copies of
14852  this manual provided the copyright notice and this permission notice
14853 @@ -73,7 +73,7 @@ except that this permission notice may b
14854  by the Free Software Foundation.
14856  @vskip 0pt plus 1filll
14857 -Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
14858 +Copyright @copyright{} 1988-2001 Free Software Foundation, Inc.
14859  @end titlepage
14861  @ifinfo
14862 Index: readline/doc/hstech.texinfo
14863 ===================================================================
14864 RCS file: /prjz/.cvsroot/gdb/readline/doc/hstech.texinfo,v
14865 retrieving revision 1.1.1.1
14866 diff -u -3 -p -r1.1.1.1 hstech.texinfo
14867 --- readline/doc/hstech.texinfo 2003/02/16 21:36:33     1.1.1.1
14868 +++ readline/doc/hstech.texinfo 2001/03/12 10:37:38
14869 @@ -1,7 +1,7 @@
14870  @ignore
14871  This file documents the user interface to the GNU History library.
14873 -Copyright (C) 1988, 1991, 1994, 1996 Free Software Foundation, Inc.
14874 +Copyright (C) 1988-2001 Free Software Foundation, Inc.
14875  Authored by Brian Fox and Chet Ramey.
14877  Permission is granted to make and distribute verbatim copies of this manual
14878 @@ -27,9 +27,9 @@ into another language, under the above c
14879  @chapter Programming with GNU History
14881  This chapter describes how to interface programs that you write
14882 -with the GNU History Library.
14883 +with the @sc{gnu} History Library.
14884  It should be considered a technical guide.
14885 -For information on the interactive use of GNU History, @pxref{Using
14886 +For information on the interactive use of @sc{gnu} History, @pxref{Using
14887  History Interactively}.
14889  @menu
14890 @@ -43,10 +43,10 @@ History Interactively}.
14891  @node Introduction to History
14892  @section Introduction to History
14894 -Many programs read input from the user a line at a time.  The GNU History
14895 -library is able to keep track of those lines, associate arbitrary data with
14896 -each line, and utilize information from previous lines in composing new
14897 -ones.
14898 +Many programs read input from the user a line at a time.  The @sc{gnu}
14899 +History library is able to keep track of those lines, associate arbitrary
14900 +data with each line, and utilize information from previous lines in
14901 +composing new ones. 
14903  The programmer using the History library has available functions
14904  for remembering lines on a history list, associating arbitrary data
14905 @@ -80,9 +80,11 @@ The history list is an array of history 
14906  declared as follows:
14908  @example
14909 +typedef void *histdata_t;
14911  typedef struct _hist_entry @{
14912    char *line;
14913 -  char *data;
14914 +  histdata_t data;
14915  @} HIST_ENTRY;
14916  @end example
14918 @@ -95,12 +97,14 @@ HIST_ENTRY **the_history_list;
14919  The state of the History library is encapsulated into a single structure:
14921  @example
14922 -/* A structure used to pass the current state of the history stuff around. */
14924 + * A structure used to pass around the current state of the history.
14925 + */
14926  typedef struct _hist_state @{
14927 -  HIST_ENTRY **entries;         /* Pointer to the entries themselves. */
14928 -  int offset;                   /* The location pointer within this array. */
14929 -  int length;                   /* Number of elements within this array. */
14930 -  int size;                     /* Number of slots allocated to this array. */
14931 +  HIST_ENTRY **entries; /* Pointer to the entries themselves. */
14932 +  int offset;           /* The location pointer within this array. */
14933 +  int length;           /* Number of elements within this array. */
14934 +  int size;             /* Number of slots allocated to this array. */
14935    int flags;
14936  @} HISTORY_STATE;
14937  @end example
14938 @@ -112,7 +116,7 @@ stifled.
14939  @section History Functions
14941  This section describes the calling sequence for the various functions
14942 -present in GNU History.
14943 +exported by the @sc{gnu} History library.
14945  @menu
14946  * Initializing History and State Management::  Functions to call when you
14947 @@ -139,12 +143,12 @@ This section describes functions used to
14948  the state of the History library when you want to use the history
14949  functions in your program.
14951 -@deftypefun void using_history ()
14952 +@deftypefun void using_history (void)
14953  Begin a session in which the history functions might be used.  This
14954  initializes the interactive variables.
14955  @end deftypefun
14957 -@deftypefun {HISTORY_STATE *} history_get_history_state ()
14958 +@deftypefun {HISTORY_STATE *} history_get_history_state (void)
14959  Return a structure describing the current state of the input history.
14960  @end deftypefun
14962 @@ -158,7 +162,7 @@ Set the state of the history list accord
14963  These functions manage individual entries on the history list, or set
14964  parameters managing the list itself.
14966 -@deftypefun void add_history (char *string)
14967 +@deftypefun void add_history (const char *string)
14968  Place @var{string} at the end of the history list.  The associated data
14969  field (if any) is set to @code{NULL}.
14970  @end deftypefun
14971 @@ -169,13 +173,13 @@ removed element is returned so you can f
14972  and containing structure.
14973  @end deftypefun
14975 -@deftypefun {HIST_ENTRY *} replace_history_entry (int which, char *line, char *data)
14976 +@deftypefun {HIST_ENTRY *} replace_history_entry (int which, const char *line, histdata_t data)
14977  Make the history entry at offset @var{which} have @var{line} and @var{data}.
14978  This returns the old entry so you can dispose of the data.  In the case
14979  of an invalid @var{which}, a @code{NULL} pointer is returned.
14980  @end deftypefun
14982 -@deftypefun void clear_history ()
14983 +@deftypefun void clear_history (void)
14984  Clear the history list by deleting all the entries.
14985  @end deftypefun
14987 @@ -183,13 +187,13 @@ Clear the history list by deleting all t
14988  Stifle the history list, remembering only the last @var{max} entries.
14989  @end deftypefun
14991 -@deftypefun int unstifle_history ()
14992 +@deftypefun int unstifle_history (void)
14993  Stop stifling the history.  This returns the previous amount the
14994  history was stifled.  The value is positive if the history was
14995  stifled, negative if it wasn't.
14996  @end deftypefun
14998 -@deftypefun int history_is_stifled ()
14999 +@deftypefun int history_is_stifled (void)
15000  Returns non-zero if the history is stifled, zero if it is not.
15001  @end deftypefun
15003 @@ -199,29 +203,30 @@ Returns non-zero if the history is stifl
15004  These functions return information about the entire history list or
15005  individual list entries.
15007 -@deftypefun {HIST_ENTRY **} history_list ()
15008 -Return a @code{NULL} terminated array of @code{HIST_ENTRY} which is the
15009 +@deftypefun {HIST_ENTRY **} history_list (void)
15010 +Return a @code{NULL} terminated array of @code{HIST_ENTRY *} which is the
15011  current input history.  Element 0 of this list is the beginning of time.
15012  If there is no history, return @code{NULL}.
15013  @end deftypefun
15015 -@deftypefun int where_history ()
15016 +@deftypefun int where_history (void)
15017  Returns the offset of the current history element.
15018  @end deftypefun
15020 -@deftypefun {HIST_ENTRY *} current_history ()
15021 +@deftypefun {HIST_ENTRY *} current_history (void)
15022  Return the history entry at the current position, as determined by
15023 -@code{where_history ()}.  If there is no entry there, return a @code{NULL}
15024 +@code{where_history()}.  If there is no entry there, return a @code{NULL}
15025  pointer.
15026  @end deftypefun
15028  @deftypefun {HIST_ENTRY *} history_get (int offset)
15029  Return the history entry at position @var{offset}, starting from
15030 -@code{history_base}.  If there is no entry there, or if @var{offset}
15031 +@code{history_base} (@pxref{History Variables}).
15032 +If there is no entry there, or if @var{offset}
15033  is greater than the history length, return a @code{NULL} pointer.
15034  @end deftypefun
15036 -@deftypefun int history_total_bytes ()
15037 +@deftypefun int history_total_bytes (void)
15038  Return the number of bytes that the primary history entries are using.
15039  This function returns the sum of the lengths of all the lines in the
15040  history.
15041 @@ -234,17 +239,19 @@ These functions allow the current index 
15042  set or changed.
15044  @deftypefun int history_set_pos (int pos)
15045 -Set the position in the history list to @var{pos}, an absolute index
15046 +Set the current history offset to @var{pos}, an absolute index
15047  into the list.
15048 +Returns 1 on success, 0 if @var{pos} is less than zero or greater
15049 +than the number of history entries.
15050  @end deftypefun
15052 -@deftypefun {HIST_ENTRY *} previous_history ()
15053 +@deftypefun {HIST_ENTRY *} previous_history (void)
15054  Back up the current history offset to the previous history entry, and
15055  return a pointer to that entry.  If there is no previous entry, return
15056  a @code{NULL} pointer.
15057  @end deftypefun
15059 -@deftypefun {HIST_ENTRY *} next_history ()
15060 +@deftypefun {HIST_ENTRY *} next_history (void)
15061  Move the current history offset forward to the next history entry, and
15062  return the a pointer to that entry.  If there is no next entry, return
15063  a @code{NULL} pointer.
15064 @@ -260,26 +267,28 @@ from the current history position.  The 
15065  meaning that the string must match at the beginning of the history entry.
15066  @cindex anchored search
15068 -@deftypefun int history_search (char *string, int direction)
15069 -Search the history for @var{string}, starting at the current history
15070 -offset.  If @var{direction} < 0, then the search is through previous entries,
15071 -else through subsequent.  If @var{string} is found, then
15072 +@deftypefun int history_search (const char *string, int direction)
15073 +Search the history for @var{string}, starting at the current history offset.
15074 +If @var{direction} is less than 0, then the search is through
15075 +previous entries, otherwise through subsequent entries.
15076 +If @var{string} is found, then
15077  the current history index is set to that history entry, and the value
15078  returned is the offset in the line of the entry where
15079  @var{string} was found.  Otherwise, nothing is changed, and a -1 is
15080  returned.
15081  @end deftypefun
15083 -@deftypefun int history_search_prefix (char *string, int direction)
15084 +@deftypefun int history_search_prefix (const char *string, int direction)
15085  Search the history for @var{string}, starting at the current history
15086  offset.  The search is anchored: matching lines must begin with
15087 -@var{string}.  If @var{direction} < 0, then the search is through previous
15088 -entries, else through subsequent.  If @var{string} is found, then the
15089 +@var{string}.  If @var{direction} is less than 0, then the search is
15090 +through previous entries, otherwise through subsequent entries.
15091 +If @var{string} is found, then the
15092  current history index is set to that entry, and the return value is 0. 
15093  Otherwise, nothing is changed, and a -1 is returned. 
15094  @end deftypefun
15096 -@deftypefun int history_search_pos (char *string, int direction, int pos)
15097 +@deftypefun int history_search_pos (const char *string, int direction, int pos)
15098  Search for @var{string} in the history list, starting at @var{pos}, an
15099  absolute index into the list.  If @var{direction} is negative, the search
15100  proceeds backward from @var{pos}, otherwise forward.  Returns the absolute
15101 @@ -292,41 +301,46 @@ index of the history element where @var{
15102  The History library can read the history from and write it to a file.
15103  This section documents the functions for managing a history file.
15105 -@deftypefun int read_history (char *filename)
15106 -Add the contents of @var{filename} to the history list, a line at a
15107 -time.  If @var{filename} is @code{NULL}, then read from
15108 -@file{~/.history}.  Returns 0 if successful, or errno if not.
15109 +@deftypefun int read_history (const char *filename)
15110 +Add the contents of @var{filename} to the history list, a line at a time.
15111 +If @var{filename} is @code{NULL}, then read from @file{~/.history}.
15112 +Returns 0 if successful, or @code{errno} if not.
15113  @end deftypefun
15115 -@deftypefun int read_history_range (char *filename, int from, int to)
15116 +@deftypefun int read_history_range (const char *filename, int from, int to)
15117  Read a range of lines from @var{filename}, adding them to the history list.
15118 -Start reading at line @var{from} and end at @var{to}.  If
15119 -@var{from} is zero, start at the beginning.  If @var{to} is less than
15120 +Start reading at line @var{from} and end at @var{to}.
15121 +If @var{from} is zero, start at the beginning.  If @var{to} is less than
15122  @var{from}, then read until the end of the file.  If @var{filename} is
15123  @code{NULL}, then read from @file{~/.history}.  Returns 0 if successful,
15124  or @code{errno} if not.
15125  @end deftypefun
15127 -@deftypefun int write_history (char *filename)
15128 +@deftypefun int write_history (const char *filename)
15129  Write the current history to @var{filename}, overwriting @var{filename}
15130 -if necessary.  If @var{filename} is
15131 -@code{NULL}, then write the history list to @file{~/.history}.  Values
15132 -returned are as in @code{read_history ()}.
15133 +if necessary.
15134 +If @var{filename} is @code{NULL}, then write the history list to
15135 +@file{~/.history}.
15136 +Returns 0 on success, or @code{errno} on a read or write error.
15137  @end deftypefun
15139 -@deftypefun int append_history (int nelements, char *filename)
15140 +@deftypefun int append_history (int nelements, const char *filename)
15141  Append the last @var{nelements} of the history list to @var{filename}.
15142 +If @var{filename} is @code{NULL}, then append to @file{~/.history}.
15143 +Returns 0 on success, or @code{errno} on a read or write error.
15144  @end deftypefun
15146 -@deftypefun int history_truncate_file (char *filename, int nlines)
15147 +@deftypefun int history_truncate_file (const char *filename, int nlines)
15148  Truncate the history file @var{filename}, leaving only the last
15149  @var{nlines} lines.
15150 +If @var{filename} is @code{NULL}, then @file{~/.history} is truncated.
15151 +Returns 0 on success, or @code{errno} on failure.
15152  @end deftypefun
15154  @node History Expansion
15155  @subsection History Expansion
15157 -These functions implement @code{csh}-like history expansion.
15158 +These functions implement history expansion.
15160  @deftypefun int history_expand (char *string, char **output)
15161  Expand @var{string}, placing the result into @var{output}, a pointer
15162 @@ -334,7 +348,7 @@ to a string (@pxref{History Interaction}
15163  @table @code
15164  @item 0
15165  If no expansions took place (or, if the only change in
15166 -the text was the de-slashifying of the history expansion
15167 +the text was the removal of escape characters preceding the history expansion
15168  character);
15169  @item 1
15170  if expansions did take place;
15171 @@ -348,13 +362,8 @@ as with the @code{:p} modifier (@pxref{M
15172  If an error ocurred in expansion, then @var{output} contains a descriptive
15173  error message.
15174  @end deftypefun
15176 -@deftypefun {char *} history_arg_extract (int first, int last, char *string)
15177 -Extract a string segment consisting of the @var{first} through @var{last}
15178 -arguments present in @var{string}.  Arguments are broken up as in Bash.
15179 -@end deftypefun
15181 -@deftypefun {char *} get_history_event (char *string, int *cindex, int qchar)
15182 +@deftypefun {char *} get_history_event (const char *string, int *cindex, int qchar)
15183  Returns the text of the history event beginning at @var{string} +
15184  @var{*cindex}.  @var{*cindex} is modified to point to after the event
15185  specifier.  At function entry, @var{cindex} points to the index into
15186 @@ -363,18 +372,24 @@ is a character that is allowed to end th
15187  to the ``normal'' terminating characters.
15188  @end deftypefun
15190 -@deftypefun {char **} history_tokenize (char *string)
15191 +@deftypefun {char **} history_tokenize (const char *string)
15192  Return an array of tokens parsed out of @var{string}, much as the
15193 -shell might.  The tokens are split on white space and on the
15194 -characters @code{()<>;&|$}, and shell quoting conventions are
15195 -obeyed.
15196 +shell might.  The tokens are split on the characters in the
15197 +@var{history_word_delimiters} variable,
15198 +and shell quoting conventions are obeyed.
15199  @end deftypefun
15201 +@deftypefun {char *} history_arg_extract (int first, int last, const char *string)
15202 +Extract a string segment consisting of the @var{first} through @var{last}
15203 +arguments present in @var{string}.  Arguments are split using
15204 +@code{history_tokenize}.
15205 +@end deftypefun
15207  @node History Variables
15208  @section History Variables
15210 -This section describes the externally visible variables exported by
15211 -the GNU History Library.
15212 +This section describes the externally-visible variables exported by
15213 +the @sc{gnu} History Library.
15215  @deftypevar int history_base
15216  The logical offset of the first entry in the history list.
15217 @@ -384,13 +399,14 @@ The logical offset of the first entry in
15218  The number of entries currently stored in the history list.
15219  @end deftypevar
15221 -@deftypevar int max_input_history
15222 +@deftypevar int history_max_entries
15223  The maximum number of history entries.  This must be changed using
15224 -@code{stifle_history ()}.
15225 +@code{stifle_history()}.
15226  @end deftypevar
15228  @deftypevar char history_expansion_char
15229 -The character that starts a history event.  The default is @samp{!}.
15230 +The character that introduces a history event.  The default is @samp{!}.
15231 +Setting this to 0 inhibits history expansion.
15232  @end deftypevar
15234  @deftypevar char history_subst_char
15235 @@ -405,15 +421,20 @@ ignored, suppressing history expansion f
15236  This is disabled by default.
15237  @end deftypevar
15239 +@deftypevar {char *} history_word_delimiters
15240 +The characters that separate tokens for \fBhistory_tokenize()\fP.
15241 +The default value is @code{" \t\n()<>;&|"}.
15242 +@end deftypevar
15244  @deftypevar {char *} history_no_expand_chars
15245  The list of characters which inhibit history expansion if found immediately
15246 -following @var{history_expansion_char}.  The default is whitespace and
15247 -@samp{=}.
15248 +following @var{history_expansion_char}.  The default is space, tab, newline,
15249 +carriage return, and @samp{=}.
15250  @end deftypevar
15252  @deftypevar {char *} history_search_delimiter_chars
15253  The list of additional characters which can delimit a history search
15254 -string, in addition to whitespace, @samp{:} and @samp{?} in the case of
15255 +string, in addition to space, TAB, @samp{:} and @samp{?} in the case of
15256  a substring search.  The default is empty.
15257  @end deftypevar
15259 @@ -422,24 +443,30 @@ If non-zero, single-quoted words are not
15260  character.  The default value is 0.
15261  @end deftypevar
15263 -@deftypevar {Function *} history_inhibit_expansion_function
15264 +@deftypevar {rl_linebuf_func_t *} history_inhibit_expansion_function
15265  This should be set to the address of a function that takes two arguments:
15266 -a @code{char *} (@var{string}) and an integer index into that string (@var{i}).
15267 +a @code{char *} (@var{string})
15268 +and an @code{int} index into that string (@var{i}).
15269  It should return a non-zero value if the history expansion starting at
15270  @var{string[i]} should not be performed; zero if the expansion should
15271  be done.
15272  It is intended for use by applications like Bash that use the history
15273  expansion character for additional purposes.
15274 -By default, this variable is set to NULL.
15275 +By default, this variable is set to @code{NULL}.
15276  @end deftypevar
15278  @node History Programming Example
15279  @section History Programming Example
15281 -The following program demonstrates simple use of the GNU History Library.
15282 +The following program demonstrates simple use of the @sc{gnu} History Library.
15284  @smallexample
15285 -main ()
15286 +#include <stdio.h>
15287 +#include <readline/history.h>
15289 +main (argc, argv)
15290 +     int argc;
15291 +     char **argv;
15292  @{
15293    char line[1024], *t;
15294    int len, done = 0;
15295 Index: readline/doc/hsuser.texinfo
15296 ===================================================================
15297 RCS file: /prjz/.cvsroot/gdb/readline/doc/hsuser.texinfo,v
15298 retrieving revision 1.1.1.1
15299 diff -u -3 -p -r1.1.1.1 hsuser.texinfo
15300 --- readline/doc/hsuser.texinfo 2003/02/16 21:36:33     1.1.1.1
15301 +++ readline/doc/hsuser.texinfo 2000/11/22 17:42:50
15302 @@ -38,9 +38,9 @@ For information on using the @sc{gnu} Hi
15303  see the @sc{gnu} Readline Library Manual.
15304  @end ifset
15305  @ifclear BashFeatures
15306 -This chapter describes how to use the GNU History Library interactively,
15307 +This chapter describes how to use the @sc{gnu} History Library interactively,
15308  from a user's standpoint.  It should be considered a user's guide.  For
15309 -information on using the GNU History Library in your own programs,
15310 +information on using the @sc{gnu} History Library in your own programs,
15311  @pxref{Programming with GNU History}.
15312  @end ifclear
15314 @@ -65,36 +65,36 @@ information on using the GNU History Lib
15315  @cindex command history
15316  @cindex history list
15318 -When the @samp{-o history} option to the @code{set} builtin
15319 +When the @option{-o history} option to the @code{set} builtin
15320  is enabled (@pxref{The Set Builtin}),
15321 -the shell provides access to the @var{command history},
15322 +the shell provides access to the @dfn{command history},
15323  the list of commands previously typed.
15324 -The value of the @code{HISTSIZE} shell variable is used as the
15325 +The value of the @env{HISTSIZE} shell variable is used as the
15326  number of commands to save in a history list.
15327 -The text of the last @code{$HISTSIZE}
15328 +The text of the last @env{$HISTSIZE}
15329  commands (default 500) is saved.
15330  The shell stores each command in the history list prior to
15331  parameter and variable expansion
15332  but after history expansion is performed, subject to the
15333  values of the shell variables
15334 -@code{HISTIGNORE} and @code{HISTCONTROL}.
15335 +@env{HISTIGNORE} and @env{HISTCONTROL}.
15337  When the shell starts up, the history is initialized from the
15338 -file named by the @code{HISTFILE} variable (default @file{~/.bash_history}).
15339 -The file named by the value of @code{HISTFILE} is truncated, if
15340 +file named by the @env{HISTFILE} variable (default @file{~/.bash_history}).
15341 +The file named by the value of @env{HISTFILE} is truncated, if
15342  necessary, to contain no more than the number of lines specified by
15343 -the value of the @code{HISTFILESIZE} variable.
15344 +the value of the @env{HISTFILESIZE} variable.
15345  When an interactive shell exits, the last
15346 -@code{$HISTSIZE} lines are copied from the history list to the file
15347 -named by @code{$HISTFILE}.
15348 +@env{$HISTSIZE} lines are copied from the history list to the file
15349 +named by @env{$HISTFILE}.
15350  If the @code{histappend} shell option is set (@pxref{Bash Builtins}),
15351  the lines are appended to the history file,
15352  otherwise the history file is overwritten.
15353 -If @code{HISTFILE}
15354 +If @env{HISTFILE}
15355  is unset, or if the history file is unwritable, the history is
15356  not saved.  After saving the history, the history file is truncated
15357 -to contain no more than @code{$HISTFILESIZE}
15358 -lines.  If @code{HISTFILESIZE} is not set, no truncation is performed.
15359 +to contain no more than @env{$HISTFILESIZE}
15360 +lines.  If @env{HISTFILESIZE} is not set, no truncation is performed.
15362  The builtin command @code{fc} may be used to list or edit and re-execute
15363  a portion of the history list.
15364 @@ -105,7 +105,7 @@ are available in each editing mode that 
15365  history list (@pxref{Commands For History}).
15367  The shell allows control over which commands are saved on the history
15368 -list.  The @code{HISTCONTROL} and @code{HISTIGNORE}
15369 +list.  The @env{HISTCONTROL} and @env{HISTIGNORE}
15370  variables may be set to cause the shell to save only a subset of the
15371  commands entered.
15372  The @code{cmdhist}
15373 @@ -141,15 +141,15 @@ command beginning with that string) or a
15374  history list, where a negative number is used as an offset from the
15375  current command number).  If @var{last} is not specified it is set to
15376  @var{first}.  If @var{first} is not specified it is set to the previous
15377 -command for editing and @minus{}16 for listing.  If the @samp{-l} flag is
15378 -given, the commands are listed on standard output.  The @samp{-n} flag
15379 -suppresses the command numbers when listing.  The @samp{-r} flag
15380 +command for editing and @minus{}16 for listing.  If the @option{-l} flag is
15381 +given, the commands are listed on standard output.  The @option{-n} flag
15382 +suppresses the command numbers when listing.  The @option{-r} flag
15383  reverses the order of the listing.  Otherwise, the editor given by
15384  @var{ename} is invoked on a file containing those commands.  If
15385  @var{ename} is not given, the value of the following variable expansion
15386  is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}.  This says to use the
15387 -value of the @code{FCEDIT} variable if set, or the value of the
15388 -@code{EDITOR} variable if that is set, or @code{vi} if neither is set.
15389 +value of the @env{FCEDIT} variable if set, or the value of the
15390 +@env{EDITOR} variable if that is set, or @code{vi} if neither is set.
15391  When editing is complete, the edited commands are echoed and executed.
15393  In the second form, @var{command} is re-executed after each instance
15394 @@ -170,7 +170,7 @@ history -ps @var{arg}
15395  @end example
15397  With no options, display the history list with line numbers.
15398 -Lines prefixed with with a @samp{*} have been modified.
15399 +Lines prefixed with a @samp{*} have been modified.
15400  An argument of @var{n} lists only the last @var{n} lines.
15401  Options, if supplied, have the following meanings:
15403 @@ -211,10 +211,10 @@ the history list as a single entry.
15405  @end table
15407 -When any of the @samp{-w}, @samp{-r}, @samp{-a}, or @samp{-n} options is
15408 +When any of the @option{-w}, @option{-r}, @option{-a}, or @option{-n} options is
15409  used, if @var{filename}
15410  is given, then it is used as the history file.  If not, then
15411 -the value of the @code{HISTFILE} variable is used.
15412 +the value of the @env{HISTFILE} variable is used.
15414  @end table
15415  @end ifset
15416 @@ -260,9 +260,9 @@ editing buffer for further modification.
15417  If Readline is being used, and the @code{histreedit}
15418  shell option is enabled, a failed history expansion will be
15419  reloaded into the Readline editing buffer for correction.
15420 -The @samp{-p} option to the @code{history} builtin command
15421 +The @option{-p} option to the @code{history} builtin command
15422  may be used to see what a history expansion will do before using it.
15423 -The @samp{-s} option to the @code{history} builtin may be used to
15424 +The @option{-s} option to the @code{history} builtin may be used to
15425  add commands to the end of the history list without actually executing
15426  them, so that they are available for subsequent recall.
15427  This is most useful in conjunction with Readline.
15428 Index: readline/doc/manvers.texinfo
15429 ===================================================================
15430 RCS file: /prjz/.cvsroot/gdb/readline/doc/manvers.texinfo,v
15431 retrieving revision 1.1.1.1
15432 diff -u -3 -p -r1.1.1.1 manvers.texinfo
15433 --- readline/doc/manvers.texinfo        2003/02/16 21:36:33     1.1.1.1
15434 +++ readline/doc/manvers.texinfo        2001/04/16 14:54:00
15435 @@ -1,6 +1,6 @@
15436 -@set EDITION 4.1
15437 -@set VERSION 4.1
15438 -@set UPDATED 2000 January 19
15439 -@set UPDATE-MONTH January 2000
15440 +@set EDITION 4.2
15441 +@set VERSION 4.2
15442 +@set UPDATED 2001 Apr 16
15443 +@set UPDATE-MONTH Apr 2001
15445 -@set LASTCHANGE Wed Jan 19 12:16:30 EST 2000
15446 +@set LASTCHANGE Mon Apr 16 10:53:58 EDT 2001
15447 Index: readline/doc/readline.3
15448 ===================================================================
15449 RCS file: /prjz/.cvsroot/gdb/readline/doc/readline.3,v
15450 retrieving revision 1.1.1.1
15451 diff -u -3 -p -r1.1.1.1 readline.3
15452 --- readline/doc/readline.3     2003/02/16 21:36:33     1.1.1.1
15453 +++ readline/doc/readline.3     2001/03/05 16:11:38
15454 @@ -6,9 +6,9 @@
15455  .\"    Case Western Reserve University
15456  .\"    chet@ins.CWRU.Edu
15457  .\"
15458 -.\"    Last Change: Tue Jun  1 13:28:03 EDT 1999
15459 +.\"    Last Change: Mon Mar  5 09:58:38 EST 2001
15460  .\"
15461 -.TH READLINE 3 "1999 Jun 1" GNU
15462 +.TH READLINE 3 "2001 Mar 5" "GNU Readline 4.2"
15463  .\"
15464  .\" File Name macro.  This used to be `.PN', for Path Name,
15465  .\" but Sun doesn't seem to like that very much.
15466 @@ -23,20 +23,19 @@ readline \- get a line from a user with 
15467  .nf
15468  .ft B
15469  #include <stdio.h>
15470 -#include <readline.h>
15471 -#include <history.h>
15472 +#include <readline/readline.h>
15473 +#include <readline/history.h>
15474  .ft
15475  .fi
15476  .LP
15477  .nf
15478 -.ft B
15479 -char *readline (prompt)
15480 -char *prompt;
15481 -.ft
15482 +\fIchar *\fP
15483 +.br
15484 +\fBreadline\fP (\fIconst char *prompt\fP);
15485  .fi
15486  .SH COPYRIGHT
15487 -.if n Readline is Copyright (C) 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
15488 -.if t Readline is Copyright \(co 1989, 1991, 1993, 1995, 1996 by the Free Software Foundation, Inc.
15489 +.if n Readline is Copyright (C) 1989\-2001 by the Free Software Foundation, Inc.
15490 +.if t Readline is Copyright \(co 1989\-2001 by the Free Software Foundation, Inc.
15491  .SH DESCRIPTION
15492  .LP
15493  .B readline
15494 @@ -45,9 +44,10 @@ and return it, using
15495  .B prompt
15496  as a prompt.  If 
15497  .B prompt
15498 -is null, no prompt is issued.  The line returned is allocated with
15499 -.IR malloc (3),
15500 -so the caller must free it when finished.  The line returned
15501 +is \fBNULL\fP or the empty string, no prompt is issued.
15502 +The line returned is allocated with
15503 +.IR malloc (3);
15504 +the caller must free it when finished.  The line returned
15505  has the final newline removed, so only the text of the line
15506  remains.
15507  .LP
15508 @@ -57,6 +57,11 @@ line.
15509  By default, the line editing commands
15510  are similar to those of emacs.
15511  A vi\-style line editing interface is also available.
15512 +.LP
15513 +This manual page describes only the most basic use of \fBreadline\fP.
15514 +Much more functionality is available; see
15515 +\fIThe GNU Readline Library\fP and \fIThe GNU History Library\fP
15516 +for additional information.
15517  .SH RETURN VALUE
15518  .LP
15519  .B readline
15520 @@ -130,6 +135,7 @@ or
15521  .RS
15522  C\-Meta\-u: universal\-argument
15523  .RE
15524 +.sp
15525  into the 
15526  .I inputrc
15527  would make M\-C\-u execute the readline command
15528 @@ -137,15 +143,16 @@ would make M\-C\-u execute the readline 
15529  .PP
15530  The following symbolic character names are recognized while
15531  processing key bindings:
15532 -.IR RUBOUT ,
15533  .IR DEL ,
15534  .IR ESC ,
15535 +.IR ESCAPE ,
15536  .IR LFD ,
15537  .IR NEWLINE ,
15538  .IR RET ,
15539  .IR RETURN ,
15540 -.IR SPC ,
15541 +.IR RUBOUT ,
15542  .IR SPACE ,
15543 +.IR SPC ,
15544  and
15545  .IR TAB .
15546  .PP
15547 @@ -161,6 +168,7 @@ command or the text of a macro and a key
15548  it should be bound. The name may be specified in one of two ways:
15549  as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
15550  prefixes, or as a key sequence.
15551 +.PP
15552  When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
15553  .I keyname
15554  is the name of a key spelled out in English.  For example:
15555 @@ -170,7 +178,7 @@ Control\-u: universal\-argument
15556  .br
15557  Meta\-Rubout: backward\-kill\-word
15558  .br
15559 -Control\-o: ">&output"
15560 +Control\-o: "> output"
15561  .RE
15562  .LP
15563  In the above example,
15564 @@ -184,7 +192,8 @@ and
15565  .I C\-o
15566  is bound to run the macro
15567  expressed on the right hand side (that is, to insert the text
15568 -.I >&output
15569 +.if t \f(CW> output\fP
15570 +.if n ``> output''
15571  into the line).
15572  .PP
15573  In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
15574 @@ -194,7 +203,8 @@ differs from
15575  above in that strings denoting
15576  an entire key sequence may be specified by placing the sequence
15577  within double quotes.  Some GNU Emacs style key escapes can be
15578 -used, as in the following example.
15579 +used, as in the following example, but the symbolic character names
15580 +are not recognized.
15581  .sp
15582  .RS
15583  "\eC\-u": universal\-argument
15584 @@ -214,8 +224,11 @@ is bound to the function
15585  and 
15586  .I "ESC [ 1 1 ~"
15587  is bound to insert the text
15588 -.BR "Function Key 1" .
15589 -The full set of GNU Emacs style escape sequences is
15590 +.if t \f(CWFunction Key 1\fP.
15591 +.if n ``Function Key 1''.
15592 +.PP
15593 +The full set of GNU Emacs style escape sequences available when specifying
15594 +key sequences is
15595  .RS
15596  .PD 0
15597  .TP
15598 @@ -232,10 +245,10 @@ an escape character
15599  backslash
15600  .TP
15601  .B \e"
15602 -literal "
15603 +literal ", a double quote
15604  .TP
15605  .B \e'
15606 -literal '
15607 +literal ', a single quote
15608  .RE
15609  .PD
15610  .PP
15611 @@ -313,7 +326,8 @@ file with a statement of the form
15612  Except where noted, readline variables can take the values
15613  .B On
15614  or
15615 -.BR Off .
15616 +.B Off
15617 +(without regard to case).
15618  The variables and their default values are:
15619  .PP
15620  .PD 0
15621 @@ -351,7 +365,7 @@ on the terminal.
15622  .B convert\-meta (On)
15623  If set to \fBOn\fP, readline will convert characters with the
15624  eighth bit set to an ASCII key sequence
15625 -by stripping the eighth bit and prepending an
15626 +by stripping the eighth bit and prefixing it with an
15627  escape character (in effect, using escape as the \fImeta prefix\fP).
15628  .TP
15629  .B disable\-completion (Off)
15630 @@ -361,7 +375,7 @@ mapped to \fBself-insert\fP.
15631  .TP
15632  .B editing\-mode (emacs)
15633  Controls whether readline begins with a set of key bindings similar
15634 -to \fIemacs\fP or \fIvi\fP.
15635 +to emacs or vi.
15636  .B editing\-mode
15637  can be set to either
15638  .B emacs
15639 @@ -384,12 +398,12 @@ becomes longer than the screen width rat
15640  .TP
15641  .B input\-meta (Off)
15642  If set to \fBOn\fP, readline will enable eight-bit input (that is,
15643 -it will not strip the high bit from the characters it reads),
15644 +it will not clear the eighth bit in the characters it reads),
15645  regardless of what the terminal claims it can support.  The name
15646  .B meta\-flag
15647  is a synonym for this variable.
15648  .TP
15649 -.B isearch\-terminators (``C\-[C\-J'')
15650 +.B isearch\-terminators (``C\-[ C\-J'')
15651  The string of characters that should terminate an incremental
15652  search without subsequently executing the character as a command.
15653  If this variable has not been given a value, the characters
15654 @@ -402,13 +416,13 @@ vi-command\fP, and
15655  .IR vi-insert .
15656  \fIvi\fP is equivalent to \fIvi-command\fP; \fIemacs\fP is
15657  equivalent to \fIemacs-standard\fP.  The default value is
15658 -.IR emacs ;
15659 -the value of
15660 +.IR emacs .
15661 +The value of
15662  .B editing\-mode
15663  also affects the default keymap.
15664  .TP
15665  .B mark\-directories (On)
15666 -If set to \fBOn\fP, complete<d directory names have a slash
15667 +If set to \fBOn\fP, completed directory names have a slash
15668  appended.
15669  .TP
15670  .B mark\-modified\-lines (Off)
15671 @@ -433,7 +447,7 @@ matches to be listed immediately instead
15672  .TP
15673  .B visible\-stats (Off)
15674  If set to \fBOn\fP, a character denoting a file's type as reported  
15675 -by \fBstat\fP(2) is appended to the filename when listing possible
15676 +by \fIstat\fP(2) is appended to the filename when listing possible
15677  completions.
15678  .PD
15679  .SS Conditional Constructs
15680 @@ -481,7 +495,7 @@ key sequence that quotes the current or 
15681  .sp 1
15682  .RS
15683  .nf
15684 -\fB$if\fP bash
15685 +\fB$if\fP Bash
15686  # Quote the current or previous word
15687  "\eC-xq": "\eeb\e"\eef\e""
15688  \fB$endif\fP
15689 @@ -519,22 +533,27 @@ As each character of the search string i
15690  the next entry from the history matching the string typed so far.
15691  An incremental search requires only as many characters as needed to
15692  find the desired history entry.
15693 -The characters present in the value of the \fIisearch-terminators\fP
15694 +To search backward in the history for a particular string, type
15695 +\fBC\-r\fP.  Typing \fBC\-s\fP searches forward through the history.
15696 +The characters present in the value of the \fBisearch-terminators\fP
15697  variable are used to terminate an incremental search.
15698 -If that variable has not been assigned a value the Escape and
15699 -Control-J characters will terminate an incremental search.
15700 -Control-G will abort an incremental search and restore the original
15701 +If that variable has not been assigned a value the \fIEscape\fP and
15702 +\fBC\-J\fP characters will terminate an incremental search.
15703 +\fBC\-G\fP will abort an incremental search and restore the original
15704  line.
15705  When the search is terminated, the history entry containing the
15706  search string becomes the current line.
15707 -To find other matching entries in the history list, type Control-S or
15708 -Control-R as appropriate.
15709 +.PP
15710 +To find other matching entries in the history list, type \fBC\-s\fP or
15711 +\fBC\-r\fP as appropriate.
15712  This will search backward or forward in the history for the next
15713  line matching the search string typed so far.
15714  Any other key sequence bound to a readline command will terminate
15715  the search and execute that command.
15716 -For instance, a \fInewline\fP will terminate the search and accept
15717 +For instance, a newline will terminate the search and accept
15718  the line, thereby executing the command from the history list.
15719 +A movement command will terminate the search, make the last line found
15720 +the current line, and begin editing.
15721  .PP
15722  Non-incremental searches read the entire search string before starting
15723  to search for matching history lines.  The search string may be
15724 @@ -544,6 +563,11 @@ typed by the user or be part of the cont
15725  The following is a list of the names of the commands and the default
15726  key sequences to which they are bound.
15727  Command names without an accompanying key sequence are unbound by default.
15728 +.PP
15729 +In the following descriptions, \fIpoint\fP refers to the current cursor
15730 +position, and \fImark\fP refers to a cursor position saved by the
15731 +\fBset\-mark\fP command.
15732 +The text between the point and mark is referred to as the \fIregion\fP.
15733  .SS Commands for Moving
15734  .PP
15735  .PD 0
15736 @@ -581,9 +605,11 @@ Refresh the current line.
15737  .PD 0
15738  .TP
15739  .B accept\-line (Newline, Return)
15740 -Accept the line regardless of where the cursor is.  If this line is
15741 -non-empty, add it to the history list. If the line is a modified
15742 -history line, then restore the history line to its original state.
15743 +Accept the line regardless of where the cursor is.
15744 +If this line is
15745 +non-empty, it may be added to the history list for future recall with
15746 +\fBadd_history()\fP.
15747 +If the line is a modified history line, the history line is restored to its original state.
15748  .TP
15749  .B previous\-history (C\-p)
15750  Fetch the previous command from the history list, moving back in
15751 @@ -629,8 +655,8 @@ This is a non-incremental search.
15752  .TP
15753  .B yank\-nth\-arg (M\-C\-y)
15754  Insert the first argument to the previous command (usually
15755 -the second word on the previous line) at point (the current
15756 -cursor position).  With an argument
15757 +the second word on the previous line) at point.
15758 +With an argument
15759  .IR n ,
15760  insert the \fIn\fPth word from the previous command (the words
15761  in the previous command begin with word 0).  A negative argument
15762 @@ -649,9 +675,9 @@ list, inserting the last argument of eac
15763  .PD 0
15764  .TP
15765  .B delete\-char (C\-d)
15766 -Delete the character under the cursor.  If point is at the
15767 +Delete the character at point.  If point is at the
15768  beginning of the line, there are no characters in the line, and
15769 -the last character typed was not bound to \fBBdelete\-char\fP, then return
15770 +the last character typed was not bound to \fBdelete\-char\fP, then return
15771  .SM
15772  .BR EOF .
15773  .TP
15774 @@ -662,7 +688,7 @@ save the deleted text on the kill ring.
15775  .B forward\-backward\-delete\-char   
15776  Delete the character under the cursor, unless the cursor is at the
15777  end of the line, in which case the character behind the cursor is
15778 -deleted.  By default, this is not bound to a key.
15779 +deleted.
15780  .TP
15781  .B quoted\-insert (C\-q, C\-v)
15782  Add the next character that you type to the line verbatim.  This is
15783 @@ -675,13 +701,15 @@ Insert a tab character.
15784  Insert the character typed.
15785  .TP
15786  .B transpose\-chars (C\-t)
15787 -Drag the character before point forward over the character at point.
15788 -Point moves forward as well.  If point is at the end of the line, then
15789 -transpose the two characters before point.  Negative arguments don't work.
15790 +Drag the character before point forward over the character at point,
15791 +moving point forward as well.
15792 +If point is at the end of the line, then this transposes
15793 +the two characters before point.
15794 +Negative arguments have no effect.
15795  .TP
15796  .B transpose\-words (M\-t)
15797 -Drag the word behind the cursor past the word in front of the cursor
15798 -moving the cursor over that word as well.
15799 +Drag the word before point past the word after point,
15800 +moving point over that word as well.
15801  .TP
15802  .B upcase\-word (M\-u)
15803  Uppercase the current (or following) word.  With a negative argument,
15804 @@ -700,7 +728,7 @@ capitalize the previous word, but do not
15805  .PD 0
15806  .TP
15807  .B kill\-line (C\-k)
15808 -Kill the text from the current cursor position to the end of the line.
15809 +Kill the text from point to the end of the line.
15810  .TP
15811  .B backward\-kill\-line (C\-x Rubout)
15812  Kill backward to the beginning of the line.
15813 @@ -711,22 +739,20 @@ The killed text is saved on the kill-rin
15814  .\" There is no real difference between this and backward-kill-line
15815  .TP
15816  .B kill\-whole\-line
15817 -Kill all characters on the current line, no matter where the
15818 -cursor is.
15819 +Kill all characters on the current line, no matter where point is.
15820  .TP
15821  .B kill\-word  (M\-d)
15822 -Kill from the cursor to the end of the current word, or if between
15823 +Kill from point the end of the current word, or if between
15824  words, to the end of the next word.  Word boundaries are the same as
15825  those used by \fBforward\-word\fP.
15826  .TP
15827  .B backward\-kill\-word (M\-Rubout)
15828 -Kill the word behind the cursor.  Word boundaries are the same as
15829 -those used by \fBbackward\-word\fP.
15830 +Kill the word behind point.
15831 +Word boundaries are the same as those used by \fBbackward\-word\fP.
15832  .TP
15833  .B unix\-word\-rubout (C\-w)
15834 -Kill the word behind the cursor, using white space as a word boundary.
15835 -The word boundaries are different from
15836 -.BR backward\-kill\-word .
15837 +Kill the word behind point, using white space as a word boundary.
15838 +The killed text is saved on the kill-ring.
15839  .TP
15840  .B delete\-horizontal\-space (M\-\e)
15841  Delete all spaces and tabs around point.
15842 @@ -747,7 +773,7 @@ Copy the word following point to the kil
15843  The word boundaries are the same as \fBforward\-word\fP.
15844  .TP
15845  .B yank (C\-y)
15846 -Yank the top of the kill ring into the buffer at the cursor.
15847 +Yank the top of the kill ring into the buffer at point.
15848  .TP
15849  .B yank\-pop (M\-y)
15850  Rotate the kill ring, and yank the new top.  Only works following
15851 @@ -808,8 +834,9 @@ Similar to \fBcomplete\fP, but replaces 
15852  with a single match from the list of possible completions.
15853  Repeated execution of \fBmenu\-complete\fP steps through the list
15854  of possible completions, inserting each match in turn.
15855 -At the end of the list of completions, the bell is rung and the
15856 -original text is restored.
15857 +At the end of the list of completions, the bell is rung
15858 +(subject to the setting of \Bbell\-style\fP)
15859 +and the original text is restored.
15860  An argument of \fIn\fP moves \fIn\fP positions forward in the list
15861  of matches; a negative argument may be used to move backward 
15862  through the list.
15863 @@ -821,7 +848,6 @@ Deletes the character under the cursor i
15864  end of the line (like \fBdelete-char\fP).
15865  If at the end of the line, behaves identically to
15866  \fBpossible-completions\fP.
15867 -This command is unbound by default.
15868  .PD
15869  .SS Keyboard Macros
15870  .PP
15871 @@ -874,8 +900,8 @@ command enough times to return the line 
15872  .B tilde\-expand (M\-&)
15873  Perform tilde expansion on the current word.
15874  .TP
15875 -.B set\-mark (C\-@, M-<space>)
15876 -Set the mark to the current point.  If a
15877 +.B set\-mark (C\-@, M\-<space>)
15878 +Set the mark to the point.  If a
15879  numeric argument is supplied, the mark is set to that position.
15880  .TP
15881  .B exchange\-point\-and\-mark (C\-x C\-x)
15882 @@ -894,8 +920,9 @@ character.  A negative count searches fo
15883  The value of the readline
15884  .B comment\-begin
15885  variable is inserted at the beginning of the current line, and the line
15886 -is accepted as if a newline had been typed.  This makes the current line
15887 -a shell comment.
15888 +is accepted as if a newline had been typed.  The default value of
15889 +.B comment\-begin
15890 +makes the current line a shell comment.
15891  .TP
15892  .B dump\-functions
15893  Print all of the functions and their key bindings to the
15894 @@ -932,25 +959,23 @@ editing mode.
15895  .SH DEFAULT KEY BINDINGS
15896  .LP
15897  The following is a list of the default emacs and vi bindings.
15898 -Characters with the 8th bit set are written as M\-<character>, and
15899 +Characters with the eighth bit set are written as M\-<character>, and
15900  are referred to as
15901  .I metafied
15902  characters.
15903  The printable ASCII characters not mentioned in the list of emacs
15904  standard bindings are bound to the
15905 -.I self\-insert
15906 +.B self\-insert
15907  function, which just inserts the given character into the input line.
15908  In vi insertion mode, all characters not specifically mentioned are
15909  bound to
15910 -.IR self\-insert .
15911 +.BR self\-insert .
15912  Characters assigned to signal generation by
15913  .IR stty (1)
15914  or the terminal driver, such as C-Z or C-C,
15915  retain that function.
15916 -Upper and lower case
15917 -.I metafied
15918 -characters are bound to the same function in the emacs mode
15919 -meta keymap.
15920 +Upper and lower case metafied characters are bound to the same function in
15921 +the emacs mode meta keymap.
15922  The remaining characters are unbound, which causes readline
15923  to ring the bell (subject to the setting of the
15924  .B bell\-style
15925 @@ -1036,7 +1061,7 @@ Emacs Meta bindings
15926  "M-Y"  yank-pop
15927  "M-\e"  delete-horizontal-space
15928  "M-~"  tilde-expand
15929 -"M-C-?"  backward-delete-word
15930 +"M-C-?"  backward-kill-word
15931  "M-_"  yank-last-arg
15932  .PP
15933  Emacs Control-X bindings
15934 @@ -1096,6 +1121,7 @@ VI Command Mode functions
15935  "C-V"  quoted-insert
15936  "C-W"  unix-word-rubout
15937  "C-Y"  yank
15938 +"C-_"  vi-undo
15939  "\^ "  forward-char
15940  "#"  insert-comment
15941  "$"  end-of-line
15942 @@ -1150,7 +1176,7 @@ VI Command Mode functions
15943  "r"  vi-change-char
15944  "s"  vi-subst
15945  "t"  vi-char-search
15946 -"u"  undo
15947 +"u"  vi-undo
15948  "w"  vi-next-word
15949  "x"  vi-delete
15950  "y"  vi-yank-to
15951 Index: readline/doc/rlman.texinfo
15952 ===================================================================
15953 RCS file: /prjz/.cvsroot/gdb/readline/doc/rlman.texinfo,v
15954 retrieving revision 1.1.1.1
15955 diff -u -3 -p -r1.1.1.1 rlman.texinfo
15956 --- readline/doc/rlman.texinfo  2003/02/16 21:36:33     1.1.1.1
15957 +++ readline/doc/rlman.texinfo  2001/02/02 16:49:17
15958 @@ -18,7 +18,7 @@ This document describes the GNU Readline
15959  in the consistency of user interface across discrete programs that need
15960  to provide a command line interface.
15962 -Copyright (C) 1988-1999 Free Software Foundation, Inc.
15963 +Copyright (C) 1988-2001 Free Software Foundation, Inc.
15965  Permission is granted to make and distribute verbatim copies of
15966  this manual provided the copyright notice and this permission notice
15967 @@ -73,7 +73,7 @@ except that this permission notice may b
15968  by the Free Software Foundation.
15970  @vskip 0pt plus 1filll
15971 -Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
15972 +Copyright @copyright{} 1988-2001 Free Software Foundation, Inc.
15973  @end titlepage
15975  @ifinfo
15976 Index: readline/doc/rltech.texinfo
15977 ===================================================================
15978 RCS file: /prjz/.cvsroot/gdb/readline/doc/rltech.texinfo,v
15979 retrieving revision 1.1.1.1
15980 diff -u -3 -p -r1.1.1.1 rltech.texinfo
15981 --- readline/doc/rltech.texinfo 2003/02/16 21:36:34     1.1.1.1
15982 +++ readline/doc/rltech.texinfo 2001/03/12 10:42:09
15983 @@ -8,7 +8,7 @@ This document describes the GNU Readline
15984  in the consitency of user interface across discrete programs that need
15985  to provide a command line interface.
15987 -Copyright (C) 1988, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
15988 +Copyright (C) 1988-2001 Free Software Foundation, Inc.
15990  Permission is granted to make and distribute verbatim copies of
15991  this manual provided the copyright notice and this permission notice
15992 @@ -35,9 +35,9 @@ by the Foundation.
15993  @node Programming with GNU Readline
15994  @chapter Programming with GNU Readline
15996 -This chapter describes the interface between the GNU Readline Library and
15997 +This chapter describes the interface between the @sc{gnu} Readline Library and
15998  other programs.  If you are a programmer, and you wish to include the
15999 -features found in GNU Readline
16000 +features found in @sc{gnu} Readline
16001  such as completion, line editing, and interactive history manipulation
16002  in your own programs, this section is for you.
16004 @@ -61,18 +61,20 @@ Many programs provide a command line int
16005  @code{ftp}, and @code{sh}.  For such programs, the default behaviour of
16006  Readline is sufficient.  This section describes how to use Readline in
16007  the simplest way possible, perhaps to replace calls in your code to
16008 -@code{gets()} or @code{fgets ()}.
16009 +@code{gets()} or @code{fgets()}.
16011  @findex readline
16012  @cindex readline, function
16013 -The function @code{readline ()} prints a prompt and then reads and returns
16014 -a single line of text from the user.  The line @code{readline}
16015 -returns is allocated with @code{malloc ()}; you should @code{free ()}
16016 -the line when you are done with it.  The declaration for @code{readline}
16017 -in ANSI C is
16019 +The function @code{readline()} prints a prompt @var{prompt}
16020 +and then reads and returns a single line of text from the user.
16021 +If @var{prompt} is @code{NULL} or the empty string, no prompt is displayed.
16022 +The line @code{readline} returns is allocated with @code{malloc()};
16023 +the caller should @code{free()} the line when it has finished with it.
16024 +The declaration for @code{readline} in ANSI C is
16026  @example
16027 -@code{char *readline (char *@var{prompt});}
16028 +@code{char *readline (const char *@var{prompt});}
16029  @end example
16031  @noindent
16032 @@ -90,7 +92,7 @@ line is empty at that point, then @code{
16033  Otherwise, the line is ended just as if a newline had been typed.
16035  If you want the user to be able to get at the line later, (with
16036 -@key{C-p} for example), you must call @code{add_history ()} to save the
16037 +@key{C-p} for example), you must call @code{add_history()} to save the
16038  line away in a @dfn{history} list of such lines.
16040  @example
16041 @@ -102,7 +104,7 @@ For full details on the GNU History Libr
16043  It is preferable to avoid saving empty lines on the history list, since
16044  users rarely have a burning need to reuse a blank line.  Here is
16045 -a function which usefully replaces the standard @code{gets ()} library
16046 +a function which usefully replaces the standard @code{gets()} library
16047  function, and has the advantage of no static buffer to overflow:
16049  @example
16050 @@ -135,17 +137,17 @@ rl_gets ()
16051  This function gives the user the default behaviour of @key{TAB}
16052  completion: completion on file names.  If you do not want Readline to
16053  complete on filenames, you can change the binding of the @key{TAB} key
16054 -with @code{rl_bind_key ()}.
16055 +with @code{rl_bind_key()}.
16057  @example
16058 -@code{int rl_bind_key (int @var{key}, int (*@var{function})());}
16059 +@code{int rl_bind_key (int @var{key}, rl_command_func_t *@var{function});}
16060  @end example
16062 -@code{rl_bind_key ()} takes two arguments: @var{key} is the character that
16063 +@code{rl_bind_key()} takes two arguments: @var{key} is the character that
16064  you want to bind, and @var{function} is the address of the function to
16065 -call when @var{key} is pressed.  Binding @key{TAB} to @code{rl_insert ()}
16066 +call when @var{key} is pressed.  Binding @key{TAB} to @code{rl_insert()}
16067  makes @key{TAB} insert itself.
16068 -@code{rl_bind_key ()} returns non-zero if @var{key} is not a valid
16069 +@code{rl_bind_key()} returns non-zero if @var{key} is not a valid
16070  ASCII character code (between 0 and 255).
16072  Thus, to disable the default @key{TAB} behavior, the following suffices:
16073 @@ -154,7 +156,7 @@ Thus, to disable the default @key{TAB} b
16074  @end example
16076  This code should be executed once at the start of your program; you
16077 -might write a function called @code{initialize_readline ()} which
16078 +might write a function called @code{initialize_readline()} which
16079  performs this and other desired initializations, such as installing
16080  custom completers (@pxref{Custom Completers}).
16082 @@ -175,45 +177,72 @@ in @code{readline.h} use the @code{stdio
16083  @code{<stdio.h>} should be included before @code{readline.h}.
16085  @menu
16086 -* The Function Type::  C declarations to make code readable.
16087 +* Readline Typedefs::  C declarations to make code readable.
16088  * Function Writing::   Variables and calling conventions.
16089  @end menu
16091 -@node The Function Type
16092 -@subsection The Function Type
16093 +@node Readline Typedefs
16094 +@subsection Readline Typedefs
16096 -For readabilty, we declare a new type of object, called
16097 -@dfn{Function}.  A @code{Function} is a C function which
16098 -returns an @code{int}.  The type declaration for @code{Function} is:
16099 +For readabilty, we declare a number of new object types, all pointers
16100 +to functions.
16102 -@noindent
16103 -@code{typedef int Function ();}
16104 +The reason for declaring these new types is to make it easier to write
16105 +code describing pointers to C functions with appropriately prototyped
16106 +arguments and return values.
16108 +For instance, say we want to declare a variable @var{func} as a pointer
16109 +to a function which takes two @code{int} arguments and returns an
16110 +@code{int} (this is the type of all of the Readline bindable functions).
16111 +Instead of the classic C declaration
16113 -The reason for declaring this new type is to make it easier to write
16114 -code describing pointers to C functions.  Let us say we had a variable
16115 -called @var{func} which was a pointer to a function.  Instead of the
16116 -classic C declaration
16117 +@code{int (*func)();}
16119 +@noindent
16120 +or the ANSI-C style declaration
16122 -@code{int (*)()func;}
16123 +@code{int (*func)(int, int);}
16125  @noindent
16126  we may write
16128 -@code{Function *func;}
16129 +@code{rl_command_func_t *func;}
16131 -@noindent
16132 -Similarly, there are
16133 +The full list of function pointer types available is
16135 -@example
16136 -typedef void VFunction ();
16137 -typedef char *CPFunction (); @r{and}
16138 -typedef char **CPPFunction ();
16139 -@end example
16140 +@table @code
16141 +@item typedef int rl_command_func_t (int, int);
16143 -@noindent
16144 -for functions returning no value, @code{pointer to char}, and
16145 -@code{pointer to pointer to char}, respectively.
16146 +@item typedef char *rl_compentry_func_t (const char *, int);
16148 +@item typedef char **rl_completion_func_t (const char *, int, int);
16150 +@item typedef char *rl_quote_func_t (char *, int, char *);
16152 +@item typedef char *rl_dequote_func_t (char *, int);
16154 +@item typedef int rl_compignore_func_t (char **);
16156 +@item typedef void rl_compdisp_func_t (char **, int, int);
16158 +@item typedef int rl_hook_func_t (void);
16160 +@item typedef int rl_getc_func_t (FILE *);
16162 +@item typedef int rl_linebuf_func_t (char *, int);
16164 +@item typedef int rl_intfunc_t (int);
16165 +@item #define rl_ivoidfunc_t rl_hook_func_t
16166 +@item typedef int rl_icpfunc_t (char *);
16167 +@item typedef int rl_icppfunc_t (char **);
16169 +@item typedef void rl_voidfunc_t (void);
16170 +@item typedef void rl_vintfunc_t (int);
16171 +@item typedef void rl_vcpfunc_t (char *);
16172 +@item typedef void rl_vcppfunc_t (char **);
16174 +@end table
16176  @node Function Writing
16177  @subsection Writing a New Function
16179 @@ -265,7 +294,7 @@ The number of characters present in @cod
16180  @end deftypevar
16182  @deftypevar int rl_mark
16183 -The mark (saved position) in the current line.  If set, the mark
16184 +The @var{mark} (saved position) in the current line.  If set, the mark
16185  and point define a @emph{region}.
16186  @end deftypevar
16188 @@ -274,11 +303,23 @@ Setting this to a non-zero value causes 
16189  line immediately.
16190  @end deftypevar
16192 +@deftypevar int rl_num_chars_to_read
16193 +Setting this to a positive value before calling @code{readline()} causes
16194 +Readline to return after accepting that many characters, rather
16195 +than reading up to a character bound to @code{accept-line}.
16196 +@end deftypevar
16198  @deftypevar int rl_pending_input
16199  Setting this to a value makes it the next keystroke read.  This is a
16200  way to stuff a single character into the input stream.
16201  @end deftypevar
16203 +@deftypevar int rl_dispatching
16204 +Set to a non-zero value if a function is being called from a key binding;
16205 +zero otherwise.  Application functions can test this to discover whether
16206 +they were called directly or by Readline's dispatching mechanism.
16207 +@end deftypevar
16209  @deftypevar int rl_erase_empty_line
16210  Setting this to a non-zero value causes Readline to completely erase
16211  the current line, including any prompt, any time a newline is typed as
16212 @@ -288,7 +329,9 @@ the beginning of the newly-blank line.
16214  @deftypevar {char *} rl_prompt
16215  The prompt Readline uses.  This is set from the argument to
16216 -@code{readline ()}, and should not be assigned to directly.
16217 +@code{readline()}, and should not be assigned to directly.
16218 +The @code{rl_set_prompt()} function (@pxref{Redisplay}) may
16219 +be used to modify the prompt string after calling @code{readline()}.
16220  @end deftypevar
16222  @deftypevar int rl_already_prompted
16223 @@ -301,15 +344,22 @@ The calling application is responsible f
16224  never sets it.
16225  @end deftypevar
16227 -@deftypevar {char *} rl_library_version
16228 +@deftypevar {const char *} rl_library_version
16229  The version number of this revision of the library.
16230  @end deftypevar
16232 +@deftypevar {int} rl_gnu_readline_p
16233 +Always set to 1, denoting that this is @sc{gnu} readline rather than some
16234 +emulation.
16235 +@end deftypevar
16237 -@deftypevar {char *} rl_terminal_name
16238 -The terminal type, used for initialization.
16239 +@deftypevar {const char *} rl_terminal_name
16240 +The terminal type, used for initialization.  If not set by the application,
16241 +Readline sets this to the value of the @env{TERM} environment variable
16242 +the first time it is called.
16243  @end deftypevar
16245 -@deftypevar {char *} rl_readline_name
16246 +@deftypevar {const char *} rl_readline_name
16247  This variable is set to a unique name by each application using Readline.
16248  The value allows conditional parsing of the inputrc file
16249  (@pxref{Conditional Init Constructs}).
16250 @@ -323,36 +373,60 @@ The stdio stream from which Readline rea
16251  The stdio stream to which Readline performs output.
16252  @end deftypevar
16254 -@deftypevar {Function *} rl_startup_hook
16255 +@deftypevar {rl_command_func_t *} rl_last_func
16256 +The address of the last command function Readline executed.  May be used to
16257 +test whether or not a function is being executed twice in succession, for
16258 +example.
16259 +@end deftypevar
16261 +@deftypevar {rl_hook_func_t *} rl_startup_hook
16262  If non-zero, this is the address of a function to call just
16263  before @code{readline} prints the first prompt.
16264  @end deftypevar
16266 -@deftypevar {Function *} rl_pre_input_hook
16267 +@deftypevar {rl_hook_func_t *} rl_pre_input_hook
16268  If non-zero, this is the address of a function to call after
16269  the first prompt has been printed and just before @code{readline}
16270  starts reading input characters.
16271  @end deftypevar
16273 -@deftypevar {Function *} rl_event_hook
16274 +@deftypevar {rl_hook_func_t *} rl_event_hook
16275  If non-zero, this is the address of a function to call periodically
16276 -when readline is waiting for terminal input.
16277 +when Readline is waiting for terminal input.
16278 +By default, this will be called at most ten times a second if there
16279 +is no keyboard input.
16280  @end deftypevar
16282 -@deftypevar {Function *} rl_getc_function
16283 -If non-zero, @code{readline} will call indirectly through this pointer
16284 +@deftypevar {rl_getc_func_t *} rl_getc_function
16285 +If non-zero, Readline will call indirectly through this pointer
16286  to get a character from the input stream.  By default, it is set to
16287 -@code{rl_getc}, the default @code{readline} character input function
16288 -(@pxref{Utility Functions}).
16289 +@code{rl_getc}, the default Readline character input function
16290 +(@pxref{Character Input}).
16291  @end deftypevar
16293 -@deftypevar {VFunction *} rl_redisplay_function
16294 -If non-zero, @code{readline} will call indirectly through this pointer
16295 +@deftypevar {rl_voidfunc_t *} rl_redisplay_function
16296 +If non-zero, Readline will call indirectly through this pointer
16297  to update the display with the current contents of the editing buffer.
16298 -By default, it is set to @code{rl_redisplay}, the default @code{readline}
16299 +By default, it is set to @code{rl_redisplay}, the default Readline
16300  redisplay function (@pxref{Redisplay}).
16301  @end deftypevar
16303 +@deftypevar {rl_vintfunc_t *} rl_prep_term_function
16304 +If non-zero, Readline will call indirectly through this pointer
16305 +to initialize the terminal.  The function takes a single argument, an
16306 +@code{int} flag that says whether or not to use eight-bit characters.
16307 +By default, this is set to @code{rl_prep_terminal}
16308 +(@pxref{Terminal Management}).
16309 +@end deftypevar
16311 +@deftypevar {rl_voidfunc_t *} rl_deprep_term_function
16312 +If non-zero, Readline will call indirectly through this pointer
16313 +to reset the terminal.  This function should undo the effects of
16314 +@code{rl_prep_term_function}.
16315 +By default, this is set to @code{rl_deprep_terminal}
16316 +(@pxref{Terminal Management}).
16317 +@end deftypevar
16319  @deftypevar {Keymap} rl_executing_keymap
16320  This variable is set to the keymap (@pxref{Keymaps}) in which the
16321  currently executing readline function was found.
16322 @@ -363,6 +437,79 @@ This variable is set to the keymap (@pxr
16323  last key binding occurred.
16324  @end deftypevar 
16326 +@deftypevar {char *} rl_executing_macro
16327 +This variable is set to the text of any currently-executing macro.
16328 +@end deftypevar
16330 +@deftypevar {int} rl_readline_state
16331 +A variable with bit values that encapsulate the current Readline state.
16332 +A bit is set with the @code{RL_SETSTATE} macro, and unset with the
16333 +@code{RL_UNSETSTATE} macro.  Use the @code{RL_ISSTATE} macro to test
16334 +whether a particular state bit is set.  Current state bits include:
16336 +@table @code
16337 +@item RL_STATE_NONE
16338 +Readline has not yet been called, nor has it begun to intialize.
16339 +@item RL_STATE_INITIALIZING
16340 +Readline is initializing its internal data structures.
16341 +@item RL_STATE_INITIALIZED
16342 +Readline has completed its initialization.
16343 +@item RL_STATE_TERMPREPPED
16344 +Readline has modified the terminal modes to do its own input and redisplay.
16345 +@item RL_STATE_READCMD
16346 +Readline is reading a command from the keyboard.
16347 +@item RL_STATE_METANEXT
16348 +Readline is reading more input after reading the meta-prefix character.
16349 +@item RL_STATE_DISPATCHING
16350 +Readline is dispatching to a command.
16351 +@item RL_STATE_MOREINPUT
16352 +Readline is reading more input while executing an editing command.
16353 +@item RL_STATE_ISEARCH
16354 +Readline is performing an incremental history search.
16355 +@item RL_STATE_NSEARCH
16356 +Readline is performing a non-incremental history search.
16357 +@item RL_STATE_SEARCH
16358 +Readline is searching backward or forward through the history for a string.
16359 +@item RL_STATE_NUMERICARG
16360 +Readline is reading a numeric argument.
16361 +@item RL_STATE_MACROINPUT
16362 +Readline is currently getting its input from a previously-defined keyboard
16363 +macro.
16364 +@item RL_STATE_MACRODEF
16365 +Readline is currently reading characters defining a keyboard macro.
16366 +@item RL_STATE_OVERWRITE
16367 +Readline is in overwrite mode.
16368 +@item RL_STATE_COMPLETING
16369 +Readline is performing word completion.
16370 +@item RL_STATE_SIGHANDLER
16371 +Readline is currently executing the readline signal handler.
16372 +@item RL_STATE_UNDOING
16373 +Readline is performing an undo.
16374 +@item RL_STATE_DONE
16375 +Readline has read a key sequence bound to @code{accept-line}
16376 +and is about to return the line to the caller.
16377 +@end table
16379 +@end deftypevar
16381 +@deftypevar {int} rl_explicit_arg
16382 +Set to a non-zero value if an explicit numeric argument was specified by
16383 +the user.  Only valid in a bindable command function.
16384 +@end deftypevar
16386 +@deftypevar {int} rl_numeric_arg
16387 +Set to the value of any numeric argument explicitly specified by the user
16388 +before executing the current Readline function.  Only valid in a bindable
16389 +command function.
16390 +@end deftypevar
16392 +@deftypevar {int} rl_editing_mode
16393 +Set to a value denoting Readline's current editing mode.  A value of
16394 +@var{1} means Readline is currently in emacs mode; @var{0}
16395 +means that vi mode is active.
16396 +@end deftypevar
16399  @node Readline Convenience Functions
16400  @section Readline Convenience Functions
16402 @@ -375,8 +522,12 @@ last key binding occurred.
16403  * Allowing Undoing::   How to make your functions undoable.
16404  * Redisplay::          Functions to control line display.
16405  * Modifying Text::     Functions to modify @code{rl_line_buffer}.
16406 +* Character Input::    Functions to read keyboard input.
16407 +* Terminal Management::        Functions to manage terminal settings.
16408  * Utility Functions::  Generally useful functions and hooks.
16409 +* Miscellaneous Functions::    Functions that don't fall into any category.
16410  * Alternate Interface::        Using Readline in a `callback' fashion.
16411 +* A Readline Example::         An example Readline function.
16412  @end menu
16414  @node Function Naming
16415 @@ -396,10 +547,10 @@ This binds the keystroke @key{Meta-Rubou
16416  programmer, should bind the functions you write to descriptive names as
16417  well.  Readline provides a function for doing that:
16419 -@deftypefun int rl_add_defun (char *name, Function *function, int key)
16420 +@deftypefun int rl_add_defun (const char *name, rl_command_func_t *function, int key)
16421  Add @var{name} to the list of named functions.  Make @var{function} be
16422  the function that gets called.  If @var{key} is not -1, then bind it to
16423 -@var{function} using @code{rl_bind_key ()}.
16424 +@var{function} using @code{rl_bind_key()}.
16425  @end deftypefun
16427  Using this function alone is sufficient for most applications.  It is
16428 @@ -416,16 +567,17 @@ association between the keys that the us
16429  get run.  You can make your own keymaps, copy existing keymaps, and tell
16430  Readline which keymap to use.
16432 -@deftypefun Keymap rl_make_bare_keymap ()
16433 +@deftypefun Keymap rl_make_bare_keymap (void)
16434  Returns a new, empty keymap.  The space for the keymap is allocated with
16435 -@code{malloc ()}; you should @code{free ()} it when you are done.
16436 +@code{malloc()}; the caller should free it by calling
16437 +@code{rl_discard_keymap()} when done.
16438  @end deftypefun
16440  @deftypefun Keymap rl_copy_keymap (Keymap map)
16441  Return a new keymap which is a copy of @var{map}.
16442  @end deftypefun
16444 -@deftypefun Keymap rl_make_keymap ()
16445 +@deftypefun Keymap rl_make_keymap (void)
16446  Return a new keymap with the printing characters bound to rl_insert,
16447  the lowercase Meta characters bound to run their equivalents, and
16448  the Meta digits bound to produce numeric arguments.
16449 @@ -438,7 +590,7 @@ Free the storage associated with @var{ke
16450  Readline has several internal keymaps.  These functions allow you to
16451  change which keymap is active.
16453 -@deftypefun Keymap rl_get_keymap ()
16454 +@deftypefun Keymap rl_get_keymap (void)
16455  Returns the currently active keymap.
16456  @end deftypefun
16458 @@ -446,7 +598,7 @@ Returns the currently active keymap.
16459  Makes @var{keymap} the currently active keymap.
16460  @end deftypefun
16462 -@deftypefun Keymap rl_get_keymap_by_name (char *name)
16463 +@deftypefun Keymap rl_get_keymap_by_name (const char *name)
16464  Return the keymap matching @var{name}.  @var{name} is one which would
16465  be supplied in a @code{set keymap} inputrc line (@pxref{Readline Init File}).
16466  @end deftypefun
16467 @@ -459,28 +611,28 @@ be supplied in a @code{set keymap} input
16468  @node Binding Keys
16469  @subsection Binding Keys
16471 -You associate keys with functions through the keymap.  Readline has
16472 -several internal keymaps: @code{emacs_standard_keymap},
16473 +Key sequences are associate with functions through the keymap.
16474 +Readline has several internal keymaps: @code{emacs_standard_keymap},
16475  @code{emacs_meta_keymap}, @code{emacs_ctlx_keymap},
16476  @code{vi_movement_keymap}, and @code{vi_insertion_keymap}.
16477  @code{emacs_standard_keymap} is the default, and the examples in
16478  this manual assume that.
16480 -Since @code{readline} installs a set of default key bindings the first
16481 +Since @code{readline()} installs a set of default key bindings the first
16482  time it is called, there is always the danger that a custom binding
16483 -installed before the first call to @code{readline} will be overridden.
16484 +installed before the first call to @code{readline()} will be overridden.
16485  An alternate mechanism is to install custom key bindings in an
16486  initialization function assigned to the @code{rl_startup_hook} variable
16487  (@pxref{Readline Variables}).
16489  These functions manage key bindings.
16491 -@deftypefun int rl_bind_key (int key, Function *function)
16492 +@deftypefun int rl_bind_key (int key, rl_command_func_t *function)
16493  Binds @var{key} to @var{function} in the currently active keymap.
16494  Returns non-zero in the case of an invalid @var{key}.
16495  @end deftypefun
16497 -@deftypefun int rl_bind_key_in_map (int key, Function *function, Keymap map)
16498 +@deftypefun int rl_bind_key_in_map (int key, rl_command_func_t *function, Keymap map)
16499  Bind @var{key} to @var{function} in @var{map}.  Returns non-zero in the case
16500  of an invalid @var{key}.
16501  @end deftypefun
16502 @@ -495,15 +647,21 @@ Bind @var{key} to the null function in @
16503  Returns non-zero in case of error.
16504  @end deftypefun
16506 -@deftypefun int rl_unbind_function_in_map (Function *function, Keymap map)
16507 +@deftypefun int rl_unbind_function_in_map (rl_command_func_t *function, Keymap map)
16508  Unbind all keys that execute @var{function} in @var{map}.
16509  @end deftypefun
16511 -@deftypefun int rl_unbind_command_in_map (char *command, Keymap map)
16512 +@deftypefun int rl_unbind_command_in_map (const char *command, Keymap map)
16513  Unbind all keys that are bound to @var{command} in @var{map}.
16514  @end deftypefun
16516 -@deftypefun int rl_generic_bind (int type, char *keyseq, char *data, Keymap map)
16517 +@deftypefun int rl_set_key (const char *keyseq, rl_command_func_t *function, Keymap map)
16518 +Bind the key sequence represented by the string @var{keyseq} to the function
16519 +@var{function}.  This makes new keymaps as
16520 +necessary.  The initial keymap in which to do bindings is @var{map}.
16521 +@end deftypefun
16523 +@deftypefun int rl_generic_bind (int type, const char *keyseq, char *data, Keymap map)
16524  Bind the key sequence represented by the string @var{keyseq} to the arbitrary
16525  pointer @var{data}.  @var{type} says what kind of data is pointed to by
16526  @var{data}; this can be a function (@code{ISFUNC}), a macro
16527 @@ -517,7 +675,7 @@ perform any key bindings and variable as
16528  (@pxref{Readline Init File}).
16529  @end deftypefun
16531 -@deftypefun int rl_read_init_file (char *filename)
16532 +@deftypefun int rl_read_init_file (const char *filename)
16533  Read keybindings and variable assignments from @var{filename}
16534  (@pxref{Readline Init File}).
16535  @end deftypefun
16536 @@ -526,25 +684,26 @@ Read keybindings and variable assignment
16537  @subsection Associating Function Names and Bindings
16539  These functions allow you to find out what keys invoke named functions
16540 -and the functions invoked by a particular key sequence.
16541 +and the functions invoked by a particular key sequence.  You may also
16542 +associate a new function name with an arbitrary function.
16544 -@deftypefun {Function *} rl_named_function (char *name)
16545 +@deftypefun {rl_command_func_t *} rl_named_function (const char *name)
16546  Return the function with name @var{name}.
16547  @end deftypefun
16549 -@deftypefun {Function *} rl_function_of_keyseq (char *keyseq, Keymap map, int *type)
16550 +@deftypefun {rl_command_func_t *} rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)
16551  Return the function invoked by @var{keyseq} in keymap @var{map}.
16552 -If @var{map} is NULL, the current keymap is used.  If @var{type} is
16553 -not NULL, the type of the object is returned in it (one of @code{ISFUNC},
16554 -@code{ISKMAP}, or @code{ISMACR}).
16555 +If @var{map} is @code{NULL}, the current keymap is used.  If @var{type} is
16556 +not @code{NULL}, the type of the object is returned in the @code{int} variable
16557 +it points to (one of @code{ISFUNC}, @code{ISKMAP}, or @code{ISMACR}).
16558  @end deftypefun
16560 -@deftypefun {char **} rl_invoking_keyseqs (Function *function)
16561 +@deftypefun {char **} rl_invoking_keyseqs (rl_command_func_t *function)
16562  Return an array of strings representing the key sequences used to
16563  invoke @var{function} in the current keymap.
16564  @end deftypefun
16566 -@deftypefun {char **} rl_invoking_keyseqs_in_map (Function *function, Keymap map)
16567 +@deftypefun {char **} rl_invoking_keyseqs_in_map (rl_command_func_t *function, Keymap map)
16568  Return an array of strings representing the key sequences used to
16569  invoke @var{function} in the keymap @var{map}.
16570  @end deftypefun
16571 @@ -556,14 +715,19 @@ the list is formatted in such a way that
16572  @code{inputrc} file and re-read.
16573  @end deftypefun
16575 -@deftypefun void rl_list_funmap_names ()
16576 +@deftypefun void rl_list_funmap_names (void)
16577  Print the names of all bindable Readline functions to @code{rl_outstream}.
16578  @end deftypefun
16580 -@deftypefun {char **} rl_funmap_names ()
16581 +@deftypefun {const char **} rl_funmap_names (void)
16582  Return a NULL terminated array of known function names.  The array is
16583  sorted.  The array itself is allocated, but not the strings inside.  You
16584 -should free () the array when you done, but not the pointrs.
16585 +should @code{free()} the array when you are done, but not the pointers.
16586 +@end deftypefun
16588 +@deftypefun int rl_add_funmap_entry (const char *name, rl_command_func_t *function)
16589 +Add @var{name} to the list of bindable Readline command names, and make
16590 +@var{function} the function to be called when @var{name} is invoked.
16591  @end deftypefun
16593  @node Allowing Undoing
16594 @@ -571,17 +735,16 @@ should free () the array when you done, 
16596  Supporting the undo command is a painless thing, and makes your
16597  functions much more useful.  It is certainly easy to try
16598 -something if you know you can undo it.  I could use an undo function for
16599 -the stock market.
16600 +something if you know you can undo it.
16602  If your function simply inserts text once, or deletes text once, and
16603 -uses @code{rl_insert_text ()} or @code{rl_delete_text ()} to do it, then
16604 +uses @code{rl_insert_text()} or @code{rl_delete_text()} to do it, then
16605  undoing is already done for you automatically.
16607  If you do multiple insertions or multiple deletions, or any combination
16608  of these operations, you should group them together into one operation.
16609 -This is done with @code{rl_begin_undo_group ()} and
16610 -@code{rl_end_undo_group ()}.
16611 +This is done with @code{rl_begin_undo_group()} and
16612 +@code{rl_end_undo_group()}.
16614  The types of events that can be undone are:
16616 @@ -591,21 +754,21 @@ enum undo_code @{ UNDO_DELETE, UNDO_INSE
16618  Notice that @code{UNDO_DELETE} means to insert some text, and
16619  @code{UNDO_INSERT} means to delete some text.  That is, the undo code
16620 -tells undo what to undo, not how to undo it.  @code{UNDO_BEGIN} and
16621 -@code{UNDO_END} are tags added by @code{rl_begin_undo_group ()} and
16622 -@code{rl_end_undo_group ()}.
16623 +tells what to undo, not how to undo it.  @code{UNDO_BEGIN} and
16624 +@code{UNDO_END} are tags added by @code{rl_begin_undo_group()} and
16625 +@code{rl_end_undo_group()}.
16627 -@deftypefun int rl_begin_undo_group ()
16628 +@deftypefun int rl_begin_undo_group (void)
16629  Begins saving undo information in a group construct.  The undo
16630 -information usually comes from calls to @code{rl_insert_text ()} and
16631 -@code{rl_delete_text ()}, but could be the result of calls to
16632 -@code{rl_add_undo ()}.
16633 +information usually comes from calls to @code{rl_insert_text()} and
16634 +@code{rl_delete_text()}, but could be the result of calls to
16635 +@code{rl_add_undo()}.
16636  @end deftypefun
16638 -@deftypefun int rl_end_undo_group ()
16639 +@deftypefun int rl_end_undo_group (void)
16640  Closes the current undo group started with @code{rl_begin_undo_group
16641 -()}.  There should be one call to @code{rl_end_undo_group ()}
16642 -for each call to @code{rl_begin_undo_group ()}.
16643 +()}.  There should be one call to @code{rl_end_undo_group()}
16644 +for each call to @code{rl_begin_undo_group()}.
16645  @end deftypefun
16647  @deftypefun void rl_add_undo (enum undo_code what, int start, int end, char *text)
16648 @@ -613,17 +776,17 @@ Remember how to undo an event (according
16649  text runs from @var{start} to @var{end}, and encompasses @var{text}.
16650  @end deftypefun
16652 -@deftypefun void free_undo_list ()
16653 +@deftypefun void rl_free_undo_list (void)
16654  Free the existing undo list.
16655  @end deftypefun
16657 -@deftypefun int rl_do_undo ()
16658 +@deftypefun int rl_do_undo (void)
16659  Undo the first thing on the undo list.  Returns @code{0} if there was
16660  nothing to undo, non-zero if something was undone.
16661  @end deftypefun
16663  Finally, if you neither insert nor delete text, but directly modify the
16664 -existing text (e.g., change its case), call @code{rl_modifying ()}
16665 +existing text (e.g., change its case), call @code{rl_modifying()}
16666  once, just before you modify the text.  You must supply the indices of
16667  the text range that you are going to modify.
16669 @@ -636,22 +799,22 @@ that text.
16670  @node Redisplay
16671  @subsection Redisplay
16673 -@deftypefun void rl_redisplay ()
16674 +@deftypefun void rl_redisplay (void)
16675  Change what's displayed on the screen to reflect the current contents
16676  of @code{rl_line_buffer}.
16677  @end deftypefun
16679 -@deftypefun int rl_forced_update_display ()
16680 +@deftypefun int rl_forced_update_display (void)
16681  Force the line to be updated and redisplayed, whether or not
16682  Readline thinks the screen display is correct.
16683  @end deftypefun
16685 -@deftypefun int rl_on_new_line ()
16686 +@deftypefun int rl_on_new_line (void)
16687  Tell the update functions that we have moved onto a new (empty) line,
16688  usually after ouputting a newline.
16689  @end deftypefun
16691 -@deftypefun int rl_on_new_line_with_prompt ()
16692 +@deftypefun int rl_on_new_line_with_prompt (void)
16693  Tell the update functions that we have moved onto a new line, with
16694  @var{rl_prompt} already displayed.
16695  This could be used by applications that want to output the prompt string
16696 @@ -660,35 +823,65 @@ redisplay.
16697  It should be used after setting @var{rl_already_prompted}.
16698  @end deftypefun
16700 -@deftypefun int rl_reset_line_state ()
16701 +@deftypefun int rl_reset_line_state (void)
16702  Reset the display state to a clean state and redisplay the current line
16703  starting on a new line.
16704  @end deftypefun
16706 +@deftypefun int rl_crlf (void)
16707 +Move the cursor to the start of the next screen line.
16708 +@end deftypefun
16710 +@deftypefun int rl_show_char (int c)
16711 +Display character @var{c} on @code{rl_outstream}.
16712 +If Readline has not been set to display meta characters directly, this
16713 +will convert meta characters to a meta-prefixed key sequence.
16714 +This is intended for use by applications which wish to do their own
16715 +redisplay.
16716 +@end deftypefun
16718 -@deftypefun int rl_message (va_alist)
16719 -The arguments are a string as would be supplied to @code{printf}.  The
16720 -resulting string is displayed in the @dfn{echo area}.  The echo area
16721 +@deftypefun int rl_message (const char *, @dots{})
16722 +The arguments are a format string as would be supplied to @code{printf},
16723 +possibly containing conversion specifications such as @samp{%d}, and
16724 +any additional arguments necessary to satisfy the conversion specifications.
16725 +The resulting string is displayed in the @dfn{echo area}.  The echo area
16726  is also used to display numeric arguments and search strings.
16727  @end deftypefun
16729 -@deftypefun int rl_clear_message ()
16730 +@deftypefun int rl_clear_message (void)
16731  Clear the message in the echo area.
16732  @end deftypefun
16734 -@deftypefun void rl_save_prompt ()
16735 +@deftypefun void rl_save_prompt (void)
16736  Save the local Readline prompt display state in preparation for
16737 -displaying a new message in the message area with @code{rl_message}.
16738 +displaying a new message in the message area with @code{rl_message()}.
16739  @end deftypefun
16741 -@deftypefun void rl_restore_prompt ()
16742 +@deftypefun void rl_restore_prompt (void)
16743  Restore the local Readline prompt display state saved by the most
16744  recent call to @code{rl_save_prompt}.
16745  @end deftypefun
16747 +@deftypefun int rl_expand_prompt (char *prompt)
16748 +Expand any special character sequences in @var{prompt} and set up the
16749 +local Readline prompt redisplay variables.
16750 +This function is called by @code{readline()}.  It may also be called to
16751 +expand the primary prompt if the @code{rl_on_new_line_with_prompt()}
16752 +function or @code{rl_already_prompted} variable is used.
16753 +It returns the number of visible characters on the last line of the
16754 +(possibly multi-line) prompt.
16755 +@end deftypefun
16757 +@deftypefun int rl_set_prompt (const char *prompt)
16758 +Make Readline use @var{prompt} for subsequent redisplay.  This calls
16759 +@code{rl_expand_prompt()} to expand the prompt and sets @code{rl_prompt}
16760 +to the result.
16761 +@end deftypefun
16763  @node Modifying Text
16764  @subsection Modifying Text
16766 -@deftypefun int rl_insert_text (char *text)
16767 +@deftypefun int rl_insert_text (const char *text)
16768  Insert @var{text} into the line at the current cursor position.
16769  @end deftypefun
16771 @@ -710,53 +903,104 @@ the text is appended, otherwise prepende
16772  not a kill, a new kill ring slot is used.
16773  @end deftypefun
16775 -@node Utility Functions
16776 -@subsection Utility Functions
16778 -@deftypefun int rl_read_key ()
16779 -Return the next character available.  This handles input inserted into
16780 -the input stream via @var{pending input} (@pxref{Readline Variables})
16781 -and @code{rl_stuff_char ()}, macros, and characters read from the keyboard.
16782 +@deftypefun int rl_push_macro_input (char *macro)
16783 +Cause @var{macro} to be inserted into the line, as if it had been invoked
16784 +by a key bound to a macro.  Not especially useful; use
16785 +@code{rl_insert_text()} instead.
16786 +@end deftypefun
16788 +@node Character Input
16789 +@subsection Character Input
16791 +@deftypefun int rl_read_key (void)
16792 +Return the next character available from Readline's current input stream.
16793 +This handles input inserted into
16794 +the input stream via @var{rl_pending_input} (@pxref{Readline Variables})
16795 +and @code{rl_stuff_char()}, macros, and characters read from the keyboard.
16796 +While waiting for input, this function will call any function assigned to
16797 +the @code{rl_event_hook} variable.
16798 +@end deftypefun
16800 +@deftypefun int rl_getc (FILE *stream)
16801 +Return the next character available from @var{stream}, which is assumed to
16802 +be the keyboard.
16803  @end deftypefun
16805 -@deftypefun int rl_getc (FILE *)
16806 -Return the next character available from the keyboard.
16807 -@end deftypefun
16809  @deftypefun int rl_stuff_char (int c)
16810  Insert @var{c} into the Readline input stream.  It will be "read"
16811  before Readline attempts to read characters from the terminal with
16812 -@code{rl_read_key ()}.
16813 +@code{rl_read_key()}.
16814  @end deftypefun
16816 -@deftypefun int rl_extend_line_buffer (int len)
16817 -Ensure that @code{rl_line_buffer} has enough space to hold @var{len}
16818 -characters, possibly reallocating it if necessary.
16819 +@deftypefun int rl_execute_next (int c)
16820 +Make @var{c} be the next command to be executed when @code{rl_read_key()}
16821 +is called.  This sets @var{rl_pending_input}.
16822  @end deftypefun
16824 -@deftypefun int rl_initialize ()
16825 -Initialize or re-initialize Readline's internal state.
16826 +@deftypefun int rl_clear_pending_input (void)
16827 +Unset @var{rl_pending_input}, effectively negating the effect of any
16828 +previous call to @code{rl_execute_next()}.  This works only if the
16829 +pending input has not already been read with @code{rl_read_key()}.
16830 +@end deftypefun
16832 +@deftypefun int rl_set_keyboard_input_timeout (int u)
16833 +While waiting for keyboard input in @code{rl_read_key()}, Readline will
16834 +wait for @var{u} microseconds for input before calling any function
16835 +assigned to @code{rl_event_hook}.  The default waiting period is
16836 +one-tenth of a second.  Returns the old timeout value.
16837  @end deftypefun
16839 +@node Terminal Management
16840 +@subsection Terminal Management
16842 -@deftypefun int rl_reset_terminal (char *terminal_name)
16843 +@deftypefun void rl_prep_terminal (int meta_flag)
16844 +Modify the terminal settings for Readline's use, so @code{readline()}
16845 +can read a single character at a time from the keyboard.
16846 +The @var{meta_flag} argument should be non-zero if Readline should
16847 +read eight-bit input.
16848 +@end deftypefun
16850 +@deftypefun void rl_deprep_terminal (void)
16851 +Undo the effects of @code{rl_prep_terminal()}, leaving the terminal in
16852 +the state in which it was before the most recent call to
16853 +@code{rl_prep_terminal()}.
16854 +@end deftypefun
16856 +@deftypefun void rl_tty_set_default_bindings (Keymap kmap)
16857 +Read the operating system's terminal editing characters (as would be displayed
16858 +by @code{stty}) to their Readline equivalents.  The bindings are performed
16859 +in @var{kmap}.
16860 +@end deftypefun
16862 +@deftypefun int rl_reset_terminal (const char *terminal_name)
16863  Reinitialize Readline's idea of the terminal settings using
16864  @var{terminal_name} as the terminal type (e.g., @code{vt100}).
16865 -If @var{terminal_name} is NULL, the value of the @code{TERM}
16866 +If @var{terminal_name} is @code{NULL}, the value of the @code{TERM}
16867  environment variable is used.
16868  @end deftypefun
16870 -@deftypefun int alphabetic (int c)
16871 -Return 1 if @var{c} is an alphabetic character.
16872 +@node Utility Functions
16873 +@subsection Utility Functions
16875 +@deftypefun int rl_extend_line_buffer (int len)
16876 +Ensure that @code{rl_line_buffer} has enough space to hold @var{len}
16877 +characters, possibly reallocating it if necessary.
16878  @end deftypefun
16880 -@deftypefun int numeric (int c)
16881 -Return 1 if @var{c} is a numeric character.
16882 +@deftypefun int rl_initialize (void)
16883 +Initialize or re-initialize Readline's internal state.
16884 +It's not strictly necessary to call this; @code{readline()} calls it before
16885 +reading any input.
16886  @end deftypefun
16888 -@deftypefun int ding ()
16889 +@deftypefun int rl_ding (void)
16890  Ring the terminal bell, obeying the setting of @code{bell-style}.
16891  @end deftypefun
16893 +@deftypefun int rl_alphabetic (int c)
16894 +Return 1 if @var{c} is an alphabetic character.
16895 +@end deftypefun
16897  @deftypefun void rl_display_match_list (char **matches, int len, int max)
16898  A convenience function for displaying a list of strings in
16899  columnar format on Readline's output stream.  @code{matches} is the list
16900 @@ -767,34 +1011,71 @@ the setting of @code{print-completions-h
16901  matches are displayed (@pxref{Readline Init File Syntax}).
16902  @end deftypefun
16904 -The following are implemented as macros, defined in @code{chartypes.h}.
16905 +The following are implemented as macros, defined in @code{chardefs.h}.
16906 +Applications should refrain from using them.
16908 -@deftypefun int uppercase_p (int c)
16909 +@deftypefun int _rl_uppercase_p (int c)
16910  Return 1 if @var{c} is an uppercase alphabetic character.
16911  @end deftypefun
16913 -@deftypefun int lowercase_p (int c)
16914 +@deftypefun int _rl_lowercase_p (int c)
16915  Return 1 if @var{c} is a lowercase alphabetic character.
16916  @end deftypefun
16918 -@deftypefun int digit_p (int c)
16919 +@deftypefun int _rl_digit_p (int c)
16920  Return 1 if @var{c} is a numeric character.
16921  @end deftypefun
16923 -@deftypefun int to_upper (int c)
16924 +@deftypefun int _rl_to_upper (int c)
16925  If @var{c} is a lowercase alphabetic character, return the corresponding
16926  uppercase character.
16927  @end deftypefun
16929 -@deftypefun int to_lower (int c)
16930 +@deftypefun int _rl_to_lower (int c)
16931  If @var{c} is an uppercase alphabetic character, return the corresponding
16932  lowercase character.
16933  @end deftypefun
16935 -@deftypefun int digit_value (int c)
16936 +@deftypefun int _rl_digit_value (int c)
16937  If @var{c} is a number, return the value it represents.
16938  @end deftypefun
16940 +@node Miscellaneous Functions
16941 +@subsection Miscellaneous Functions
16943 +@deftypefun int rl_macro_bind (const char *keyseq, const char *macro, Keymap map)
16944 +Bind the key sequence @var{keyseq} to invoke the macro @var{macro}.
16945 +The binding is performed in @var{map}.  When @var{keyseq} is invoked, the
16946 +@var{macro} will be inserted into the line.  This function is deprecated;
16947 +use @code{rl_generic_bind()} instead.
16948 +@end deftypefun
16950 +@deftypefun void rl_macro_dumper (int readable)
16951 +Print the key sequences bound to macros and their values, using
16952 +the current keymap, to @code{rl_outstream}.
16953 +If @var{readable} is non-zero, the list is formatted in such a way
16954 +that it can be made part of an @code{inputrc} file and re-read.
16955 +@end deftypefun
16957 +@deftypefun int rl_variable_bind (const char *variable, const char *value)
16958 +Make the Readline variable @var{variable} have @var{value}.
16959 +This behaves as if the readline command
16960 +@samp{set @var{variable} @var{value}} had been executed in an @code{inputrc}
16961 +file (@pxref{Readline Init File Syntax}).
16962 +@end deftypefun
16964 +@deftypefun void rl_variable_dumper (int readable)
16965 +Print the readline variable names and their current values
16966 +to @code{rl_outstream}.
16967 +If @var{readable} is non-zero, the list is formatted in such a way
16968 +that it can be made part of an @code{inputrc} file and re-read.
16969 +@end deftypefun
16971 +@deftypefun int rl_set_paren_blink_timeout (int u)
16972 +Set the time interval (in microseconds) that Readline waits when showing
16973 +a balancing character when @code{blink-matching-paren} has been enabled.
16974 +@end deftypefun
16976  @node Alternate Interface
16977  @subsection Alternate Interface
16979 @@ -805,13 +1086,14 @@ on various file descriptors.  To accomod
16980  also be invoked as a `callback' function from an event loop.  There
16981  are functions available to make this easy.
16983 -@deftypefun void rl_callback_handler_install (char *prompt, Vfunction *lhandler)
16984 +@deftypefun void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhandler)
16985  Set up the terminal for readline I/O and display the initial
16986  expanded value of @var{prompt}.  Save the value of @var{lhandler} to
16987 -use as a callback when a complete line of input has been entered.
16988 +use as a function to call when a complete line of input has been entered.
16989 +The function takes the text of the line as an argument.
16990  @end deftypefun
16992 -@deftypefun void rl_callback_read_char ()
16993 +@deftypefun void rl_callback_read_char (void)
16994  Whenever an application determines that keyboard input is available, it
16995  should call @code{rl_callback_read_char()}, which will read the next
16996  character from the current input source.  If that character completes the
16997 @@ -821,12 +1103,13 @@ line.  @code{EOF} is  indicated by calli
16998  @code{NULL} line.
16999  @end deftypefun
17001 -@deftypefun void rl_callback_handler_remove ()
17002 +@deftypefun void rl_callback_handler_remove (void)
17003  Restore the terminal to its initial state and remove the line handler.
17004  This may be called from within a callback as well as independently.
17005  @end deftypefun
17007 -@subsection An Example
17008 +@node A Readline Example
17009 +@subsection A Readline Example
17011  Here is a function which changes lowercase characters to their uppercase
17012  equivalents, and uppercase characters to lowercase.  If
17013 @@ -881,10 +1164,10 @@ invert_case_line (count, key)
17015    for (i = start; i != end; i++)
17016      @{
17017 -      if (uppercase_p (rl_line_buffer[i]))
17018 -        rl_line_buffer[i] = to_lower (rl_line_buffer[i]);
17019 -      else if (lowercase_p (rl_line_buffer[i]))
17020 -        rl_line_buffer[i] = to_upper (rl_line_buffer[i]);
17021 +      if (_rl_uppercase_p (rl_line_buffer[i]))
17022 +        rl_line_buffer[i] = _rl_to_lower (rl_line_buffer[i]);
17023 +      else if (_rl_lowercase_p (rl_line_buffer[i]))
17024 +        rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]);
17025      @}
17026    /* Move point to on top of the last character changed. */
17027    rl_point = (direction == 1) ? end - 1 : start;
17028 @@ -897,44 +1180,44 @@ invert_case_line (count, key)
17030  Signals are asynchronous events sent to a process by the Unix kernel,
17031  sometimes on behalf of another process.  They are intended to indicate
17032 -exceptional events, like a user pressing the interrupt key on his
17033 -terminal, or a network connection being broken.  There is a class of
17034 -signals that can be sent to the process currently reading input from
17035 -the keyboard.  Since Readline changes the terminal attributes when it
17036 -is called, it needs to perform special processing when a signal is
17037 -received to restore the terminal to a sane state, or provide application
17038 -writers with functions to do so manually.
17039 +exceptional events, like a user pressing the interrupt key on his terminal,
17040 +or a network connection being broken.  There is a class of signals that can
17041 +be sent to the process currently reading input from the keyboard.  Since
17042 +Readline changes the terminal attributes when it is called, it needs to
17043 +perform special processing when such a signal is received in order to
17044 +restore the terminal to a sane state, or provide application writers with
17045 +functions to do so manually. 
17047  Readline contains an internal signal handler that is installed for a
17048  number of signals (@code{SIGINT}, @code{SIGQUIT}, @code{SIGTERM},
17049  @code{SIGALRM}, @code{SIGTSTP}, @code{SIGTTIN}, and @code{SIGTTOU}).
17050  When one of these signals is received, the signal handler
17051  will reset the terminal attributes to those that were in effect before
17052 -@code{readline ()} was called, reset the signal handling to what it was
17053 -before @code{readline ()} was called, and resend the signal to the calling
17054 +@code{readline()} was called, reset the signal handling to what it was
17055 +before @code{readline()} was called, and resend the signal to the calling
17056  application.
17057  If and when the calling application's signal handler returns, Readline
17058  will reinitialize the terminal and continue to accept input.
17059  When a @code{SIGINT} is received, the Readline signal handler performs
17060  some additional work, which will cause any partially-entered line to be
17061 -aborted (see the description of @code{rl_free_line_state ()}).
17062 +aborted (see the description of @code{rl_free_line_state()} below).
17064  There is an additional Readline signal handler, for @code{SIGWINCH}, which
17065  the kernel sends to a process whenever the terminal's size changes (for
17066  example, if a user resizes an @code{xterm}).  The Readline @code{SIGWINCH}
17067 -handler updates Readline's internal screen size state, and then calls any
17068 -@code{SIGWINCH} signal handler the calling application has installed. 
17069 +handler updates Readline's internal screen size information, and then calls
17070 +any @code{SIGWINCH} signal handler the calling application has installed. 
17071  Readline calls the application's @code{SIGWINCH} signal handler without
17072  resetting the terminal to its original state.  If the application's signal
17073  handler does more than update its idea of the terminal size and return (for
17074  example, a @code{longjmp} back to a main processing loop), it @emph{must}
17075 -call @code{rl_cleanup_after_signal ()} (described below), to restore the
17076 +call @code{rl_cleanup_after_signal()} (described below), to restore the
17077  terminal state. 
17079  Readline provides two variables that allow application writers to
17080  control whether or not it will catch certain signals and act on them
17081  when they are received.  It is important that applications change the
17082 -values of these variables only when calling @code{readline ()}, not in
17083 +values of these variables only when calling @code{readline()}, not in
17084  a signal handler, so Readline's internal signal state is not corrupted.
17086  @deftypevar int rl_catch_signals
17087 @@ -960,7 +1243,7 @@ and internal state cleanup upon receipt 
17089  @deftypefun void rl_cleanup_after_signal (void)
17090  This function will reset the state of the terminal to what it was before
17091 -@code{readline ()} was called, and remove the Readline signal handlers for
17092 +@code{readline()} was called, and remove the Readline signal handlers for
17093  all signals, depending on the values of @code{rl_catch_signals} and
17094  @code{rl_catch_sigwinch}.
17095  @end deftypefun
17096 @@ -969,7 +1252,7 @@ all signals, depending on the values of 
17097  This will free any partial state associated with the current input line
17098  (undo information, any partial history entry, any partially-entered
17099  keyboard macro, and any partially-entered numeric argument).  This
17100 -should be called before @code{rl_cleanup_after_signal ()}.  The
17101 +should be called before @code{rl_cleanup_after_signal()}.  The
17102  Readline signal handler for @code{SIGINT} calls this to abort the
17103  current input line.
17104  @end deftypefun
17105 @@ -981,11 +1264,26 @@ handlers, depending on the values of @co
17106  @end deftypefun
17108  If an application does not wish Readline to catch @code{SIGWINCH}, it may
17109 -call @code{rl_resize_terminal ()} to force Readline to update its idea of
17110 -the terminal size when a @code{SIGWINCH} is received.
17111 +call @code{rl_resize_terminal()} or @code{rl_set_screen_size()} to force
17112 +Readline to update its idea of the terminal size when a @code{SIGWINCH}
17113 +is received.
17115  @deftypefun void rl_resize_terminal (void)
17116 -Update Readline's internal screen size.
17117 +Update Readline's internal screen size by reading values from the kernel.
17118 +@end deftypefun
17120 +@deftypefun void rl_set_screen_size (int rows, int cols)
17121 +Set Readline's idea of the terminal size to @var{rows} rows and
17122 +@var{cols} columns.
17123 +@end deftypefun
17125 +If an application does not want to install a @code{SIGWINCH} handler, but
17126 +is still interested in the screen dimensions, Readline's idea of the screen
17127 +size may be queried.
17129 +@deftypefun void rl_get_screen_size (int *rows, int *cols)
17130 +Return Readline's idea of the terminal's size in the
17131 +variables pointed to by the arguments.
17132  @end deftypefun
17134  The following functions install and remove Readline's signal handlers.
17135 @@ -999,7 +1297,7 @@ Install Readline's signal handler for @c
17137  @deftypefun int rl_clear_signals (void)
17138  Remove all of the Readline signal handlers installed by
17139 -@code{rl_set_signals ()}.
17140 +@code{rl_set_signals()}.
17141  @end deftypefun
17143  @node Custom Completers
17144 @@ -1034,30 +1332,31 @@ There are three major functions used to 
17146  @enumerate
17147  @item
17148 -The user-interface function @code{rl_complete ()}.  This function is
17149 -called with the same arguments as other Readline
17150 -functions intended for interactive use:  @var{count} and
17151 -@var{invoking_key}.  It isolates the word to be completed and calls
17152 -@code{completion_matches ()} to generate a list of possible completions.
17153 +The user-interface function @code{rl_complete()}.  This function is
17154 +called with the same arguments as other bindable Readline functions:
17155 +@var{count} and @var{invoking_key}.
17156 +It isolates the word to be completed and calls
17157 +@code{rl_completion_matches()} to generate a list of possible completions.
17158  It then either lists the possible completions, inserts the possible
17159  completions, or actually performs the
17160  completion, depending on which behavior is desired.
17162  @item
17163 -The internal function @code{completion_matches ()} uses your
17164 -@dfn{generator} function to generate the list of possible matches, and
17165 -then returns the array of these matches.  You should place the address
17166 -of your generator function in @code{rl_completion_entry_function}.
17167 +The internal function @code{rl_completion_matches()} uses an
17168 +application-supplied @dfn{generator} function to generate the list of
17169 +possible matches, and then returns the array of these matches.
17170 +The caller should place the address of its generator function in
17171 +@code{rl_completion_entry_function}.
17173  @item
17174  The generator function is called repeatedly from
17175 -@code{completion_matches ()}, returning a string each time.  The
17176 +@code{rl_completion_matches()}, returning a string each time.  The
17177  arguments to the generator function are @var{text} and @var{state}.
17178  @var{text} is the partial word to be completed.  @var{state} is zero the
17179  first time the function is called, allowing the generator to perform
17180  any necessary initialization, and a positive non-zero integer for
17181 -each subsequent call.  When the generator function returns
17182 -@code{(char *)NULL} this signals @code{completion_matches ()} that there are
17183 +each subsequent call.  The generator function returns
17184 +@code{(char *)NULL} to inform @code{rl_completion_matches()} that there are
17185  no more possibilities left.  Usually the generator function computes the
17186  list of possible completions when @var{state} is zero, and returns them
17187  one at a time on subsequent calls.  Each string the generator function
17188 @@ -1069,14 +1368,15 @@ frees the strings when it has finished w
17189  @deftypefun int rl_complete (int ignore, int invoking_key)
17190  Complete the word at or before point.  You have supplied the function
17191  that does the initial simple matching selection algorithm (see
17192 -@code{completion_matches ()}).  The default is to do filename completion.
17193 +@code{rl_completion_matches()}).  The default is to do filename completion.
17194  @end deftypefun
17196 -@deftypevar {Function *} rl_completion_entry_function
17197 -This is a pointer to the generator function for @code{completion_matches
17198 -()}.  If the value of @code{rl_completion_entry_function} is
17199 -@code{(Function *)NULL} then the default filename generator function,
17200 -@code{filename_completion_function ()}, is used.
17201 +@deftypevar {rl_compentry_func_t *} rl_completion_entry_function
17202 +This is a pointer to the generator function for
17203 +@code{rl_completion_matches()}.
17204 +If the value of @code{rl_completion_entry_function} is
17205 +@code{NULL} then the default filename generator
17206 +function, @code{rl_filename_completion_function()}, is used.
17207  @end deftypevar
17209  @node Completion Functions
17210 @@ -1097,47 +1397,47 @@ performing partial completion.
17211  @deftypefun int rl_complete (int ignore, int invoking_key)
17212  Complete the word at or before point.  You have supplied the function
17213  that does the initial simple matching selection algorithm (see
17214 -@code{completion_matches ()} and @code{rl_completion_entry_function}).
17215 +@code{rl_completion_matches()} and @code{rl_completion_entry_function}).
17216  The default is to do filename
17217 -completion.  This calls @code{rl_complete_internal ()} with an
17218 +completion.  This calls @code{rl_complete_internal()} with an
17219  argument depending on @var{invoking_key}.
17220  @end deftypefun
17222 -@deftypefun int rl_possible_completions (int count, int invoking_key))
17223 +@deftypefun int rl_possible_completions (int count, int invoking_key)
17224  List the possible completions.  See description of @code{rl_complete
17225 -()}.  This calls @code{rl_complete_internal ()} with an argument of
17226 +()}.  This calls @code{rl_complete_internal()} with an argument of
17227  @samp{?}.
17228  @end deftypefun
17230 -@deftypefun int rl_insert_completions (int count, int invoking_key))
17231 +@deftypefun int rl_insert_completions (int count, int invoking_key)
17232  Insert the list of possible completions into the line, deleting the
17233 -partially-completed word.  See description of @code{rl_complete ()}.
17234 -This calls @code{rl_complete_internal ()} with an argument of @samp{*}.
17235 +partially-completed word.  See description of @code{rl_complete()}.
17236 +This calls @code{rl_complete_internal()} with an argument of @samp{*}.
17237  @end deftypefun
17239 -@deftypefun {char **} completion_matches (char *text, CPFunction *entry_func)
17240 -Returns an array of @code{(char *)} which is a list of completions for
17241 -@var{text}.  If there are no completions, returns @code{(char **)NULL}.
17242 +@deftypefun {char **} rl_completion_matches (const char *text, rl_compentry_func_t *entry_func)
17243 +Returns an array of strings which is a list of completions for
17244 +@var{text}.  If there are no completions, returns @code{NULL}.
17245  The first entry in the returned array is the substitution for @var{text}.
17246  The remaining entries are the possible completions.  The array is
17247  terminated with a @code{NULL} pointer.
17249  @var{entry_func} is a function of two args, and returns a
17250 -@code{(char *)}.  The first argument is @var{text}.  The second is a
17251 +@code{char *}.  The first argument is @var{text}.  The second is a
17252  state argument; it is zero on the first call, and non-zero on subsequent
17253  calls.  @var{entry_func} returns a @code{NULL}  pointer to the caller
17254  when there are no more matches.
17255  @end deftypefun
17257 -@deftypefun {char *} filename_completion_function (char *text, int state)
17258 -A generator function for filename completion in the general case.  Note
17259 -that completion in Bash is a little different because of all
17260 -the pathnames that must be followed when looking up completions for a
17261 -command.  The Bash source is a useful reference for writing custom
17262 -completion functions.
17263 +@deftypefun {char *} rl_filename_completion_function (const char *text, int state)
17264 +A generator function for filename completion in the general case.
17265 +@var{text} is a partial filename.
17266 +The Bash source is a useful reference for writing custom
17267 +completion functions (the Bash completion functions call this and other
17268 +Readline functions).
17269  @end deftypefun
17271 -@deftypefun {char *} username_completion_function (char *text, int state)
17272 +@deftypefun {char *} rl_username_completion_function (const char *text, int state)
17273  A completion generator for usernames.  @var{text} contains a partial
17274  username preceded by a random character (usually @samp{~}).  As with all
17275  completion generators, @var{state} is zero on the first call and non-zero
17276 @@ -1147,26 +1447,29 @@ for subsequent calls.
17277  @node Completion Variables
17278  @subsection Completion Variables
17280 -@deftypevar {Function *} rl_completion_entry_function
17281 -A pointer to the generator function for @code{completion_matches ()}.
17282 -@code{NULL} means to use @code{filename_completion_function ()}, the default
17283 +@deftypevar {rl_compentry_func_t *} rl_completion_entry_function
17284 +A pointer to the generator function for @code{rl_completion_matches()}.
17285 +@code{NULL} means to use @code{rl_filename_completion_function()}, the default
17286  filename completer.
17287  @end deftypevar
17289 -@deftypevar {CPPFunction *} rl_attempted_completion_function
17290 +@deftypevar {rl_completion_func_t *} rl_attempted_completion_function
17291  A pointer to an alternative function to create matches.
17292  The function is called with @var{text}, @var{start}, and @var{end}.
17293 -@var{start} and @var{end} are indices in @code{rl_line_buffer} saying
17294 -what the boundaries of @var{text} are.  If this function exists and
17295 -returns @code{NULL}, or if this variable is set to @code{NULL}, then
17296 -@code{rl_complete ()} will call the value of
17297 +@var{start} and @var{end} are indices in @code{rl_line_buffer} defining
17298 +the boundaries of @var{text}, which is a character string.
17299 +If this function exists and returns @code{NULL}, or if this variable is
17300 +set to @code{NULL}, then @code{rl_complete()} will call the value of
17301  @code{rl_completion_entry_function} to generate matches, otherwise the
17302  array of strings returned will be used.
17303 +If this function sets the @code{rl_attempted_completion_over}
17304 +variable to a non-zero value, Readline will not perform its default
17305 +completion even if this function returns no matches.
17306  @end deftypevar
17308 -@deftypevar {CPFunction *} rl_filename_quoting_function
17309 -A pointer to a function that will quote a filename in an application-
17310 -specific fashion.  This is called if filename completion is being
17311 +@deftypevar {rl_quote_func_t *} rl_filename_quoting_function
17312 +A pointer to a function that will quote a filename in an
17313 +application-specific fashion.  This is called if filename completion is being
17314  attempted and one of the characters in @code{rl_filename_quote_characters}
17315  appears in a completed filename.  The function is called with
17316  @var{text}, @var{match_type}, and @var{quote_pointer}.  The @var{text}
17317 @@ -1178,7 +1481,7 @@ to any opening quote character the user 
17318  to reset this character.
17319  @end deftypevar
17321 -@deftypevar {CPFunction *} rl_filename_dequoting_function
17322 +@deftypevar {rl_dequote_func_t *} rl_filename_dequoting_function
17323  A pointer to a function that will remove application-specific quoting
17324  characters from a filename before completion is attempted, so those
17325  characters do not interfere with matching the text against names in
17326 @@ -1188,10 +1491,10 @@ that delimits the filename (usually @sam
17327  @var{quote_char} is zero, the filename was not in an embedded string.
17328  @end deftypevar
17330 -@deftypevar {Function *} rl_char_is_quoted_p
17331 +@deftypevar {rl_linebuf_func_t *} rl_char_is_quoted_p
17332  A pointer to a function to call that determines whether or not a specific
17333  character in the line buffer is quoted, according to whatever quoting
17334 -mechanism the program calling readline uses.  The function is called with
17335 +mechanism the program calling Readline uses.  The function is called with
17336  two arguments: @var{text}, the text of the line, and @var{index}, the
17337  index of the character in the line.  It is used to decide whether a
17338  character found in @code{rl_completer_word_break_characters} should be
17339 @@ -1204,36 +1507,36 @@ possible-completions call.  After that, 
17340  she wants to see them all.  The default value is 100.
17341  @end deftypevar
17343 -@deftypevar {char *} rl_basic_word_break_characters
17344 +@deftypevar {const char *} rl_basic_word_break_characters
17345  The basic list of characters that signal a break between words for the
17346  completer routine.  The default value of this variable is the characters
17347 -which break words for completion in Bash, i.e.,
17348 +which break words for completion in Bash:
17349  @code{" \t\n\"\\'`@@$><=;|&@{("}.
17350  @end deftypevar
17352 -@deftypevar {char *} rl_basic_quote_characters
17353 -List of quote characters which can cause a word break.
17354 +@deftypevar {const char *} rl_basic_quote_characters
17355 +A list of quote characters which can cause a word break.
17356  @end deftypevar
17358 -@deftypevar {char *} rl_completer_word_break_characters
17359 +@deftypevar {const char *} rl_completer_word_break_characters
17360  The list of characters that signal a break between words for
17361 -@code{rl_complete_internal ()}.  The default list is the value of
17362 +@code{rl_complete_internal()}.  The default list is the value of
17363  @code{rl_basic_word_break_characters}.
17364  @end deftypevar
17366 -@deftypevar {char *} rl_completer_quote_characters
17367 -List of characters which can be used to quote a substring of the line.
17368 +@deftypevar {const char *} rl_completer_quote_characters
17369 +A list of characters which can be used to quote a substring of the line.
17370  Completion occurs on the entire substring, and within the substring
17371  @code{rl_completer_word_break_characters} are treated as any other character,
17372  unless they also appear within this list.
17373  @end deftypevar
17375 -@deftypevar {char *} rl_filename_quote_characters
17376 +@deftypevar {const char *} rl_filename_quote_characters
17377  A list of characters that cause a filename to be quoted by the completer
17378  when they appear in a completed filename.  The default is the null string.
17379  @end deftypevar
17381 -@deftypevar {char *} rl_special_prefixes
17382 +@deftypevar {const char *} rl_special_prefixes
17383  The list of characters that are word break characters, but should be
17384  left in @var{text} when it is passed to the completion function.
17385  Programs can use this to help determine what kind of completing to do.
17386 @@ -1252,7 +1555,8 @@ an application-specific command line syn
17387  @end deftypevar
17389  @deftypevar int rl_ignore_completion_duplicates
17390 -If non-zero, then disallow duplicates in the matches.  Default is 1.
17391 +If non-zero, then duplicates in the matches are removed.
17392 +The default is 1.
17393  @end deftypevar
17395  @deftypevar int rl_filename_completion_desired
17396 @@ -1260,8 +1564,9 @@ Non-zero means that the results of the m
17397  filenames.  This is @emph{always} zero on entry, and can only be changed
17398  within a completion entry generator function.  If it is set to a non-zero
17399  value, directory names have a slash appended and Readline attempts to
17400 -quote completed filenames if they contain any embedded word break
17401 -characters.
17402 +quote completed filenames if they contain any characters in
17403 +@code{rl_filename_quote_characters} and @code{rl_filename_quoting_desired}
17404 +is set to a non-zero value.
17405  @end deftypevar
17407  @deftypevar int rl_filename_quoting_desired
17408 @@ -1274,12 +1579,26 @@ function.  The quoting is effected via a
17409  by @code{rl_filename_quoting_function}.
17410  @end deftypevar
17412 +@deftypevar int rl_attempted_completion_over
17413 +If an application-specific completion function assigned to
17414 +@code{rl_attempted_completion_function} sets this variable to a non-zero
17415 +value, Readline will not perform its default filename completion even
17416 +if the application's completion function returns no matches.
17417 +It should be set only by an application's completion function.
17418 +@end deftypevar
17420 +@deftypevar int rl_completion_type
17421 +Set to a character describing the type of completion Readline is currently
17422 +attempting; see the description of @code{rl_complete_internal()}
17423 +(@pxref{Completion Functions}) for the list of characters.
17424 +@end deftypevar
17426  @deftypevar int rl_inhibit_completion
17427 -If this variable is non-zero, completion is inhibit<ed.  The completion
17428 +If this variable is non-zero, completion is inhibited.  The completion
17429  character will be inserted as any other bound to @code{self-insert}.
17430  @end deftypevar
17432 -@deftypevar {Function *} rl_ignore_some_completions_function
17433 +@deftypevar {rl_compignore_func_t *} rl_ignore_some_completions_function
17434  This function, if defined, is called by the completer when real filename
17435  completion is done, after all the matching names have been generated.
17436  It is passed a @code{NULL} terminated array of matches.
17437 @@ -1289,14 +1608,20 @@ re-arrange the list of matches as requir
17438  from the array must be freed.
17439  @end deftypevar
17441 -@deftypevar {Function *} rl_directory_completion_hook
17442 +@deftypevar {rl_icppfunc_t *} rl_directory_completion_hook
17443  This function, if defined, is allowed to modify the directory portion
17444  of filenames Readline completes.  It is called with the address of a
17445 -string (the current directory name) as an argument.  It could be used
17446 -to expand symbolic links or shell variables in pathnames.
17447 +string (the current directory name) as an argument, and may modify that string.
17448 +If the string is replaced with a new string, the old value should be freed.
17449 +Any modified directory name should have a trailing slash.
17450 +The modified value will be displayed as part of the completion, replacing
17451 +the directory portion of the pathname the user typed.
17452 +It returns an integer that should be non-zero if the function modifies
17453 +its directory argument.
17454 +It could be used to expand symbolic links or shell variables in pathnames.
17455  @end deftypevar
17457 -@deftypevar {VFunction *} rl_completion_display_matches_hook
17458 +@deftypevar {rl_compdisp_func_t *} rl_completion_display_matches_hook
17459  If non-zero, then this is the address of a function to call when
17460  completing a word would normally display the list of possible matches.
17461  This function is called in lieu of Readline displaying the list.
17462 @@ -1334,19 +1659,25 @@ history list.
17463  #include <readline/readline.h>
17464  #include <readline/history.h>
17466 -extern char *getwd ();
17467  extern char *xmalloc ();
17469  /* The names of functions that actually do the manipulation. */
17470 -int com_list (), com_view (), com_rename (), com_stat (), com_pwd ();
17471 -int com_delete (), com_help (), com_cd (), com_quit ();
17472 +int com_list __P((char *));
17473 +int com_view __P((char *));
17474 +int com_rename __P((char *));
17475 +int com_stat __P((char *));
17476 +int com_pwd __P((char *));
17477 +int com_delete __P((char *));
17478 +int com_help __P((char *));
17479 +int com_cd __P((char *));
17480 +int com_quit __P((char *));
17482  /* A structure which contains information on the commands this program
17483     can understand. */
17485  typedef struct @{
17486    char *name;                  /* User printable name of the function. */
17487 -  Function *func;              /* Function to call to do the job. */
17488 +  rl_icpfunc_t *func;          /* Function to call to do the job. */
17489    char *doc;                   /* Documentation for this function.  */
17490  @} COMMAND;
17492 @@ -1362,7 +1693,7 @@ COMMAND commands[] = @{
17493    @{ "rename", com_rename, "Rename FILE to NEWNAME" @},
17494    @{ "stat", com_stat, "Print out statistics on FILE" @},
17495    @{ "view", com_view, "View the contents of FILE" @},
17496 -  @{ (char *)NULL, (Function *)NULL, (char *)NULL @}
17497 +  @{ (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL @}
17498  @};
17500  /* Forward declarations. */
17501 @@ -1372,7 +1703,7 @@ COMMAND *find_command ();
17502  /* The name of this program, as taken from argv[0]. */
17503  char *progname;
17505 -/* When non-zero, this global means the user is done using this program. */
17506 +/* When non-zero, this means the user is done using this program. */
17507  int done;
17509  char *
17510 @@ -1502,29 +1833,29 @@ stripwhite (string)
17511  /*                                                                  */
17512  /* **************************************************************** */
17514 -char *command_generator ();
17515 -char **fileman_completion ();
17516 +char *command_generator __P((const char *, int));
17517 +char **fileman_completion __P((const char *, int, int));
17519 -/* Tell the GNU Readline library how to complete.  We want to try to complete
17520 -   on command names if this is the first word in the line, or on filenames
17521 -   if not. */
17522 +/* Tell the GNU Readline library how to complete.  We want to try to
17523 +   complete on command names if this is the first word in the line, or
17524 +   on filenames if not. */
17525  initialize_readline ()
17526  @{
17527    /* Allow conditional parsing of the ~/.inputrc file. */
17528    rl_readline_name = "FileMan";
17530    /* Tell the completer that we want a crack first. */
17531 -  rl_attempted_completion_function = (CPPFunction *)fileman_completion;
17532 +  rl_attempted_completion_function = fileman_completion;
17533  @}
17535 -/* Attempt to complete on the contents of TEXT.  START and END bound the
17536 -   region of rl_line_buffer that contains the word to complete.  TEXT is
17537 -   the word to complete.  We can use the entire contents of rl_line_buffer
17538 -   in case we want to do some simple parsing.  Return the array of matches,
17539 -   or NULL if there aren't any. */
17540 +/* Attempt to complete on the contents of TEXT.  START and END
17541 +   bound the region of rl_line_buffer that contains the word to
17542 +   complete.  TEXT is the word to complete.  We can use the entire
17543 +   contents of rl_line_buffer in case we want to do some simple
17544 +   parsing.  Returnthe array of matches, or NULL if there aren't any. */
17545  char **
17546  fileman_completion (text, start, end)
17547 -     char *text;
17548 +     const char *text;
17549       int start, end;
17550  @{
17551    char **matches;
17552 @@ -1535,32 +1866,33 @@ fileman_completion (text, start, end)
17553       to complete.  Otherwise it is the name of a file in the current
17554       directory. */
17555    if (start == 0)
17556 -    matches = completion_matches (text, command_generator);
17557 +    matches = rl_completion_matches (text, command_generator);
17559    return (matches);
17560  @}
17562 -/* Generator function for command completion.  STATE lets us know whether
17563 -   to start from scratch; without any state (i.e. STATE == 0), then we
17564 -   start at the top of the list. */
17565 +/* Generator function for command completion.  STATE lets us
17566 +   know whether to start from scratch; without any state
17567 +   (i.e. STATE == 0), then we start at the top of the list. */
17568  char *
17569  command_generator (text, state)
17570 -     char *text;
17571 +     const char *text;
17572       int state;
17573  @{
17574    static int list_index, len;
17575    char *name;
17577 -  /* If this is a new word to complete, initialize now.  This includes
17578 -     saving the length of TEXT for efficiency, and initializing the index
17579 -     variable to 0. */
17580 +  /* If this is a new word to complete, initialize now.  This
17581 +     includes saving the length of TEXT for efficiency, and
17582 +     initializing the index variable to 0. */
17583    if (!state)
17584      @{
17585        list_index = 0;
17586        len = strlen (text);
17587      @}
17589 -  /* Return the next name which partially matches from the command list. */
17590 +  /* Return the next name which partially matches from the
17591 +     command list. */
17592    while (name = commands[list_index].name)
17593      @{
17594        list_index++;
17595 @@ -1705,7 +2037,7 @@ com_pwd (ignore)
17596  @{
17597    char dir[1024], *s;
17599 -  s = getwd (dir);
17600 +  s = getcwd (dir, sizeof(dir) - 1);
17601    if (s == 0)
17602      @{
17603        printf ("Error getting pwd: %s\n", dir);
17604 @@ -1716,7 +2048,8 @@ com_pwd (ignore)
17605    return 0;
17606  @}
17608 -/* The user wishes to quit using this program.  Just set DONE non-zero. */
17609 +/* The user wishes to quit using this program.  Just set DONE
17610 +   non-zero. */
17611  com_quit (arg)
17612       char *arg;
17613  @{
17614 Index: readline/doc/rluser.texinfo
17615 ===================================================================
17616 RCS file: /prjz/.cvsroot/gdb/readline/doc/rluser.texinfo,v
17617 retrieving revision 1.1.1.1
17618 diff -u -3 -p -r1.1.1.1 rluser.texinfo
17619 --- readline/doc/rluser.texinfo 2003/02/16 21:36:34     1.1.1.1
17620 +++ readline/doc/rluser.texinfo 2001/03/05 16:11:53
17621 @@ -10,7 +10,7 @@ use these features.  There is a document
17622  which contains both end-user and programmer documentation for the
17623  GNU Readline Library.
17625 -Copyright (C) 1988-1999 Free Software Foundation, Inc.
17626 +Copyright (C) 1988-2000 Free Software Foundation, Inc.
17628  Authored by Brian Fox and Chet Ramey.
17630 @@ -72,11 +72,11 @@ used by several different programs, incl
17631  The following paragraphs describe the notation used to represent
17632  keystrokes.
17634 -The text @key{C-k} is read as `Control-K' and describes the character
17635 +The text @kbd{C-k} is read as `Control-K' and describes the character
17636  produced when the @key{k} key is pressed while the Control key
17637  is depressed.
17639 -The text @key{M-k} is read as `Meta-K' and describes the character
17640 +The text @kbd{M-k} is read as `Meta-K' and describes the character
17641  produced when the Meta key (if you have one) is depressed, and the @key{k}
17642  key is pressed.
17643  The Meta key is labeled @key{ALT} on many keyboards.
17644 @@ -89,11 +89,11 @@ Compose key for typing accented characte
17646  If you do not have a Meta or @key{ALT} key, or another key working as
17647  a Meta key, the identical keystroke can be generated by typing @key{ESC}
17648 -@i{first}, and then typing @key{k}.
17649 +@emph{first}, and then typing @key{k}.
17650  Either process is known as @dfn{metafying} the @key{k} key.
17652 -The text @key{M-C-k} is read as `Meta-Control-k' and describes the
17653 -character produced by @dfn{metafying} @key{C-k}.
17654 +The text @kbd{M-C-k} is read as `Meta-Control-k' and describes the
17655 +character produced by @dfn{metafying} @kbd{C-k}.
17657  In addition, several keys have their own names.  Specifically,
17658  @key{DEL}, @key{ESC}, @key{LFD}, @key{SPC}, @key{RET}, and @key{TAB} all
17659 @@ -115,8 +115,8 @@ as you type it in, allowing you to just 
17660  you to retype the majority of the line.  Using these editing commands,
17661  you move the cursor to the place that needs correction, and delete or
17662  insert the text of the corrections.  Then, when you are satisfied with
17663 -the line, you simply press @key{RETURN}.  You do not have to be at the
17664 -end of the line to press @key{RETURN}; the entire line is accepted
17665 +the line, you simply press @key{RET}.  You do not have to be at the
17666 +end of the line to press @key{RET}; the entire line is accepted
17667  regardless of the location of the cursor within the line.
17669  @menu
17670 @@ -140,9 +140,9 @@ erase character to back up and delete th
17672  Sometimes you may mistype a character, and
17673  not notice the error until you have typed several other characters.  In
17674 -that case, you can type @key{C-b} to move the cursor to the left, and then
17675 +that case, you can type @kbd{C-b} to move the cursor to the left, and then
17676  correct your mistake.  Afterwards, you can move the cursor to the right
17677 -with @key{C-f}.
17678 +with @kbd{C-f}.
17680  When you add text in the middle of a line, you will notice that characters
17681  to the right of the cursor are `pushed over' to make room for the text
17682 @@ -152,17 +152,17 @@ blank space created by the removal of th
17683  essentials for editing the text of an input line follows.
17685  @table @asis
17686 -@item @key{C-b}
17687 +@item @kbd{C-b}
17688  Move back one character.
17689 -@item @key{C-f}
17690 +@item @kbd{C-f}
17691  Move forward one character.
17692  @item @key{DEL} or @key{Backspace}
17693  Delete the character to the left of the cursor.
17694 -@item @key{C-d}
17695 +@item @kbd{C-d}
17696  Delete the character underneath the cursor.
17697  @item @w{Printing characters}
17698  Insert the character into the line at the cursor.
17699 -@item @key{C-_} or @key{C-x C-u}
17700 +@item @kbd{C-_} or @kbd{C-x C-u}
17701  Undo the last editing command.  You can undo all the way back to an
17702  empty line.
17703  @end table
17704 @@ -170,7 +170,7 @@ empty line.
17705  @noindent
17706  (Depending on your configuration, the @key{Backspace} key be set to
17707  delete the character to the left of the cursor and the @key{DEL} key set
17708 -to delete the character underneath the cursor, like @key{C-d}, rather
17709 +to delete the character underneath the cursor, like @kbd{C-d}, rather
17710  than the character to the left of the cursor.)
17712  @node Readline Movement Commands
17713 @@ -179,11 +179,11 @@ than the character to the left of the cu
17715  The above table describes the most basic keystrokes that you need
17716  in order to do editing of the input line.  For your convenience, many
17717 -other commands have been added in addition to @key{C-b}, @key{C-f},
17718 -@key{C-d}, and @key{DEL}.  Here are some commands for moving more rapidly
17719 +other commands have been added in addition to @kbd{C-b}, @kbd{C-f},
17720 +@kbd{C-d}, and @key{DEL}.  Here are some commands for moving more rapidly
17721  about the line.
17723 -@table @key
17724 +@table @kbd
17725  @item C-a
17726  Move to the start of the line.
17727  @item C-e
17728 @@ -196,7 +196,7 @@ Move backward a word.
17729  Clear the screen, reprinting the current line at the top.
17730  @end table
17732 -Notice how @key{C-f} moves forward a character, while @key{M-f} moves
17733 +Notice how @kbd{C-f} moves forward a character, while @kbd{M-f} moves
17734  forward a word.  It is a loose convention that control keystrokes
17735  operate on characters while meta keystrokes operate on words.
17737 @@ -225,36 +225,36 @@ another line.
17739  Here is the list of commands for killing text.
17741 -@table @key
17742 +@table @kbd
17743  @item C-k
17744  Kill the text from the current cursor position to the end of the line.
17746  @item M-d
17747  Kill from the cursor to the end of the current word, or, if between
17748  words, to the end of the next word.
17749 -Word boundaries are the same as those used by @key{M-f}.
17750 +Word boundaries are the same as those used by @kbd{M-f}.
17752 -@item M-DEL
17753 +@item M-@key{DEL}
17754  Kill from the cursor the start of the previous word, or, if between
17755  words, to the start of the previous word.
17756 -Word boundaries are the same as those used by @key{M-b}.
17757 +Word boundaries are the same as those used by @kbd{M-b}.
17759  @item C-w
17760  Kill from the cursor to the previous whitespace.  This is different than
17761 -@key{M-DEL} because the word boundaries differ.
17762 +@kbd{M-@key{DEL}} because the word boundaries differ.
17764  @end table
17766  Here is how to @dfn{yank} the text back into the line.  Yanking
17767  means to copy the most-recently-killed text from the kill buffer.
17769 -@table @key
17770 +@table @kbd
17771  @item C-y
17772  Yank the most recently killed text back into the buffer at the cursor.
17774  @item M-y
17775  Rotate the kill-ring, and yank the new top.  You can only do this if
17776 -the prior command is @key{C-y} or @key{M-y}.
17777 +the prior command is @kbd{C-y} or @kbd{M-y}.
17778  @end table
17780  @node Readline Arguments
17781 @@ -272,7 +272,8 @@ digits before the command.  If the first
17782  sign (@samp{-}), then the sign of the argument will be negative.  Once
17783  you have typed one meta digit to get the argument started, you can type
17784  the remainder of the digits, and then the command.  For example, to give
17785 -the @key{C-d} command an argument of 10, you could type @samp{M-1 0 C-d}.
17786 +the @kbd{C-d} command an argument of 10, you could type @samp{M-1 0 C-d},
17787 +which will delete the next ten characters on the input line.
17789  @node Searching
17790  @subsection Searching for Commands in the History
17791 @@ -282,7 +283,7 @@ Readline provides commands for searching
17792  (@pxref{Bash History Facilities})
17793  @end ifset
17794  for lines containing a specified string.
17795 -There are two search modes:  @var{incremental} and @var{non-incremental}.
17796 +There are two search modes:  @dfn{incremental} and @dfn{non-incremental}.
17798  Incremental searches begin before the user has finished typing the
17799  search string.
17800 @@ -291,23 +292,25 @@ the next entry from the history matching
17801  An incremental search requires only as many characters as needed to
17802  find the desired history entry.
17803  To search backward in the history for a particular string, type
17804 -@key{C-r}.  Typing @key{C-s} searches forward through the history.
17805 +@kbd{C-r}.  Typing @kbd{C-s} searches forward through the history.
17806  The characters present in the value of the @code{isearch-terminators} variable
17807  are used to terminate an incremental search.
17808  If that variable has not been assigned a value, the @key{ESC} and
17809 -@key{C-J} characters will terminate an incremental search.
17810 -@key{C-g} will abort an incremental search and restore the original line.
17811 +@kbd{C-J} characters will terminate an incremental search.
17812 +@kbd{C-g} will abort an incremental search and restore the original line.
17813  When the search is terminated, the history entry containing the
17814  search string becomes the current line.
17816 -To find other matching entries in the history list, type @key{C-r} or
17817 -@key{C-s} as appropriate.
17818 +To find other matching entries in the history list, type @kbd{C-r} or
17819 +@kbd{C-s} as appropriate.
17820  This will search backward or forward in the history for the next
17821  entry matching the search string typed so far.
17822  Any other key sequence bound to a Readline command will terminate
17823  the search and execute that command.
17824  For instance, a @key{RET} will terminate the search and accept
17825  the line, thereby executing the command from the history list.
17826 +A movement command will terminate the search, make the last line found
17827 +the current line, and begin editing.
17829  Non-incremental searches read the entire search string before starting
17830  to search for matching history lines.  The search string may be
17831 @@ -324,10 +327,10 @@ Any user can customize programs that use
17832  commands in an @dfn{inputrc} file, conventionally in his home directory.
17833  The name of this
17834  @ifset BashFeatures
17835 -file is taken from the value of the shell variable @code{INPUTRC}.  If
17836 +file is taken from the value of the shell variable @env{INPUTRC}.  If
17837  @end ifset
17838  @ifclear BashFeatures
17839 -file is taken from the value of the environment variable @code{INPUTRC}.  If
17840 +file is taken from the value of the environment variable @env{INPUTRC}.  If
17841  @end ifclear
17842  that variable is unset, the default is @file{~/.inputrc}.
17844 @@ -359,7 +362,15 @@ denote variable settings and key binding
17845  @item Variable Settings
17846  You can modify the run-time behavior of Readline by
17847  altering the values of variables in Readline
17848 -using the @code{set} command within the init file.  Here is how to
17849 +using the @code{set} command within the init file.
17850 +The syntax is simple:
17852 +@example
17853 +set @var{variable} @var{value}
17854 +@end example
17856 +@noindent
17857 +Here, for example, is how to
17858  change from the default Emacs-like key binding to use
17859  @code{vi} line editing commands:
17861 @@ -367,6 +378,9 @@ change from the default Emacs-like key b
17862  set editing-mode vi
17863  @end example
17865 +Variable names and values, where appropriate, are recognized without regard
17866 +to case. 
17868  @ifset BashFeatures
17869  The @w{@code{bind -V}} command lists the current Readline variable names
17870  and values.  @xref{Bash Builtins}.
17871 @@ -375,6 +389,7 @@ and values.  @xref{Bash Builtins}.
17872  A great deal of run-time behavior is changeable with the following
17873  variables.
17875 +@cindex variables, readline
17876  @table @code
17878  @item bell-style
17879 @@ -402,13 +417,14 @@ The number of possible completions that 
17880  asked whether he wants to see the list of possibilities.  If the
17881  number of possible completions is greater than this value,
17882  Readline will ask the user whether or not he wishes to view
17883 -them; otherwise, they are simply listed.  The default limit is
17884 -@code{100}.
17885 +them; otherwise, they are simply listed.
17886 +This variable must be set to an integer value greater than or equal to 0.
17887 +The default limit is @code{100}.
17889  @item convert-meta
17890  @vindex convert-meta
17891  If set to @samp{on}, Readline will convert characters with the
17892 -eighth bit set to an ASCII key sequence by stripping the eighth
17893 +eighth bit set to an @sc{ascii} key sequence by stripping the eighth
17894  bit and prefixing an @key{ESC} character, converting them to a
17895  meta-prefixed key sequence.  The default value is @samp{on}.
17897 @@ -448,7 +464,7 @@ this variable is set to @samp{off}.
17898  @vindex input-meta
17899  @vindex meta-flag
17900  If set to @samp{on}, Readline will enable eight-bit input (it
17901 -will not strip the eighth bit from the characters it reads),
17902 +will not clear the eighth bit in the characters it reads),
17903  regardless of what the terminal claims it can support.  The
17904  default value is @samp{off}.  The name @code{meta-flag} is a
17905  synonym for this variable.
17906 @@ -458,7 +474,7 @@ synonym for this variable.
17907  The string of characters that should terminate an incremental search without
17908  subsequently executing the character as a command (@pxref{Searching}).
17909  If this variable has not been given a value, the characters @key{ESC} and
17910 -@key{C-J} will terminate an incremental search.
17911 +@kbd{C-J} will terminate an incremental search.
17913  @item keymap
17914  @vindex keymap
17915 @@ -469,6 +485,7 @@ Acceptable @code{keymap} names are
17916  @code{emacs-meta},
17917  @code{emacs-ctlx},
17918  @code{vi},
17919 +@code{vi-move},
17920  @code{vi-command}, and
17921  @code{vi-insert}.
17922  @code{vi} is equivalent to @code{vi-command}; @code{emacs} is
17923 @@ -520,11 +537,15 @@ want to change.  The following sections 
17924  name, the default keybinding, if any, and a short description of what
17925  the command does.
17927 -Once you know the name of the command, simply place the name of the key
17928 +Once you know the name of the command, simply place on a line
17929 +in the init file the name of the key
17930  you wish to bind the command to, a colon, and then the name of the
17931 -command on a line in the init file.  The name of the key
17932 -can be expressed in different ways, depending on which is most
17933 -comfortable for you.
17934 +command.  The name of the key
17935 +can be expressed in different ways, depending on what you find most
17936 +comfortable.
17938 +In addition to command names, readline allows keys to be bound
17939 +to a string that is inserted when the key is pressed (a @var{macro}).
17941  @ifset BashFeatures
17942  The @w{@code{bind -p}} command displays Readline function names and
17943 @@ -541,11 +562,28 @@ Meta-Rubout: backward-kill-word
17944  Control-o: "> output"
17945  @end example
17947 -In the above example, @key{C-u} is bound to the function
17948 -@code{universal-argument}, and @key{C-o} is bound to run the macro
17949 +In the above example, @kbd{C-u} is bound to the function
17950 +@code{universal-argument},
17951 +@kbd{M-DEL} is bound to the function @code{backward-kill-word}, and
17952 +@kbd{C-o} is bound to run the macro
17953  expressed on the right hand side (that is, to insert the text
17954  @samp{> output} into the line).
17956 +A number of symbolic character names are recognized while
17957 +processing this key binding syntax:
17958 +@var{DEL},
17959 +@var{ESC},
17960 +@var{ESCAPE},
17961 +@var{LFD},
17962 +@var{NEWLINE},
17963 +@var{RET},
17964 +@var{RETURN},
17965 +@var{RUBOUT},
17966 +@var{SPACE},
17967 +@var{SPC},
17968 +and
17969 +@var{TAB}.
17971  @item @w{"@var{keyseq}": @var{function-name} or @var{macro}}
17972  @var{keyseq} differs from @var{keyname} above in that strings
17973  denoting an entire key sequence can be specified, by placing
17974 @@ -559,9 +597,9 @@ special character names are not recogniz
17975  "\e[11~": "Function Key 1"
17976  @end example
17978 -In the above example, @key{C-u} is bound to the function
17979 +In the above example, @kbd{C-u} is again bound to the function
17980  @code{universal-argument} (just as it was in the first example),
17981 -@samp{@key{C-x} @key{C-r}} is bound to the function @code{re-read-init-file},
17982 +@samp{@kbd{C-x} @kbd{C-r}} is bound to the function @code{re-read-init-file},
17983  and @samp{@key{ESC} @key{[} @key{1} @key{1} @key{~}} is bound to insert
17984  the text @samp{Function Key 1}.
17986 @@ -606,10 +644,10 @@ horizontal tab
17987  @item \v
17988  vertical tab
17989  @item \@var{nnn}
17990 -the character whose @code{ASCII} code is the octal value @var{nnn}
17991 +the character whose @sc{ascii} code is the octal value @var{nnn}
17992  (one to three digits)
17993  @item \x@var{nnn}
17994 -the character whose @code{ASCII} code is the hexadecimal value @var{nnn}
17995 +the character whose @sc{ascii} code is the hexadecimal value @var{nnn}
17996  (one to three digits)
17997  @end table
17999 @@ -619,7 +657,7 @@ Unquoted text is assumed to be a functio
18000  In the macro body, the backslash escapes described above are expanded.
18001  Backslash will quote any other character in the macro text,
18002  including @samp{"} and @samp{'}.
18003 -For example, the following binding will make @samp{C-x \}
18004 +For example, the following binding will make @samp{@kbd{C-x} \}
18005  insert a single @samp{\} into the line:
18006  @example
18007  "\C-x\\": "\\"
18008 @@ -663,7 +701,8 @@ for instance.
18009  @item application
18010  The @var{application} construct is used to include
18011  application-specific settings.  Each program using the Readline
18012 -library sets the @var{application name}, and you can test for it. 
18013 +library sets the @var{application name}, and you can test for
18014 +a particular value. 
18015  This could be used to bind key sequences to functions useful for
18016  a specific program.  For instance, the following command adds a
18017  key sequence that quotes the current or previous word in Bash:
18018 @@ -686,6 +725,7 @@ the test fails.
18019  @item $include
18020  This directive takes a single filename as an argument and reads commands
18021  and bindings from that file.
18022 +For example, the following directive reads from @file{/etc/inputrc}:
18023  @example
18024  $include /etc/inputrc
18025  @end example
18026 @@ -694,7 +734,7 @@ $include /etc/inputrc
18027  @node Sample Init File
18028  @subsection Sample Init File
18030 -Here is an example of an inputrc file.  This illustrates key
18031 +Here is an example of an @var{inputrc} file.  This illustrates key
18032  binding, variable assignment, and conditional syntax.
18034  @example
18035 @@ -759,11 +799,10 @@ TAB: complete
18036  $if Bash
18037  # edit the path
18038  "\C-xp": "PATH=$@{PATH@}\e\C-e\C-a\ef\C-f"
18039 -# prepare to type a quoted word -- insert open and close
18040 -# double quotes and move to just after the open quote
18041 +# prepare to type a quoted word -- insert open and close double quotes
18042 +# and move to just after the open quote
18043  "\C-x\"": "\"\"\C-b"
18044 -# insert a backslash (testing backslash escapes in sequences
18045 -# and macros)
18046 +# insert a backslash (testing backslash escapes in sequences and macros)
18047  "\C-x\\": "\\"
18048  # Quote the current or previous word
18049  "\C-xq": "\eb\"\ef\""
18050 @@ -820,12 +859,12 @@ You can list your key bindings by execut
18051  @w{@code{bind -P}} or, for a more terse format, suitable for an
18052  @var{inputrc} file, @w{@code{bind -p}}.  (@xref{Bash Builtins}.)
18053  @end ifset
18055  Command names without an accompanying key sequence are unbound by default.
18056 -In the following descriptions, @var{point} refers to the current cursor
18057 -position, and @var{mark} refers to a cursor position saved by the
18059 +In the following descriptions, @dfn{point} refers to the current cursor
18060 +position, and @dfn{mark} refers to a cursor position saved by the
18061  @code{set-mark} command.
18062 -The text between the point and mark is referred to as the @var{region}.
18063 +The text between the point and mark is referred to as the @dfn{region}.
18065  @node Commands For Moving
18066  @subsection Commands For Moving
18067 @@ -863,25 +902,29 @@ Refresh the current line.  By default, t
18068  @subsection Commands For Manipulating The History
18070  @ftable @code
18071 -@item accept-line (Newline, Return)
18072 +@item accept-line (Newline or Return)
18073  @ifset BashFeatures
18074 -Accept the line regardless of where the cursor is.  If this line is
18075 +Accept the line regardless of where the cursor is.
18076 +If this line is
18077  non-empty, add it to the history list according to the setting of
18078 -the @code{HISTCONTROL} and @code{HISTIGNORE} variables.
18079 -If this line was a history line, then restore the history line to its
18080 -original state.
18081 +the @env{HISTCONTROL} and @env{HISTIGNORE} variables.
18082 +If this line is a modified history line, then restore the history line
18083 +to its original state.
18084  @end ifset
18085  @ifclear BashFeatures
18086 -Accept the line regardless of where the cursor is.  If this line is
18087 -non-empty, add it to the history list.  If this line was a history
18088 -line, then restore the history line to its original state.
18089 +Accept the line regardless of where the cursor is.
18090 +If this line is
18091 +non-empty, it may be added to the history list for future recall with
18092 +@code{add_history()}.
18093 +If this line is a modified history line, the history line is restored
18094 +to its original state.
18095  @end ifclear
18097  @item previous-history (C-p)
18098 -Move `up' through the history list.
18099 +Move `back' through the history list, fetching the previous command.
18101  @item next-history (C-n)
18102 -Move `down' through the history list.
18103 +Move `forward' through the history list, fetching the next command.
18105  @item beginning-of-history (M-<)
18106  Move to the first line in the history.
18107 @@ -921,12 +964,13 @@ is a non-incremental search.  By default
18109  @item yank-nth-arg (M-C-y)
18110  Insert the first argument to the previous command (usually
18111 -the second word on the previous line).  With an argument @var{n},
18112 +the second word on the previous line) at point.
18113 +With an argument @var{n},
18114  insert the @var{n}th word from the previous command (the words
18115  in the previous command begin with word 0).  A negative argument
18116  inserts the @var{n}th word from the end of the previous command.
18118 -@item yank-last-arg (M-., M-_)
18119 +@item yank-last-arg (M-. or M-_)
18120  Insert last argument to the previous command (the last word of the
18121  previous history entry).  With an
18122  argument, behave exactly like @code{yank-nth-arg}.
18123 @@ -940,10 +984,10 @@ list, inserting the last argument of eac
18125  @ftable @code
18126  @item delete-char (C-d)
18127 -Delete the character under the cursor.  If the cursor is at the
18128 +Delete the character at point.  If point is at the
18129  beginning of the line, there are no characters in the line, and
18130  the last character typed was not bound to @code{delete-char}, then
18131 -return @code{EOF}.
18132 +return @sc{eof}.
18134  @item backward-delete-char (Rubout)
18135  Delete the character behind the cursor.  A numeric argument means
18136 @@ -954,16 +998,16 @@ Delete the character under the cursor, u
18137  end of the line, in which case the character behind the cursor is
18138  deleted.  By default, this is not bound to a key.
18140 -@item quoted-insert (C-q, C-v)
18141 +@item quoted-insert (C-q or C-v)
18142  Add the next character typed to the line verbatim.  This is
18143 -how to insert key sequences like @key{C-q}, for example.
18144 +how to insert key sequences like @kbd{C-q}, for example.
18146  @ifclear BashFeatures
18147 -@item tab-insert (M-TAB)
18148 +@item tab-insert (M-@key{TAB})
18149  Insert a tab character.
18150  @end ifclear
18152 -@item self-insert (a, b, A, 1, !, ...)
18153 +@item self-insert (a, b, A, 1, !, @dots{})
18154  Insert yourself.
18156  @item transpose-chars (C-t)
18157 @@ -1007,7 +1051,7 @@ Kill backward to the beginning of the li
18158  Kill backward from the cursor to the beginning of the current line.
18160  @item kill-whole-line ()
18161 -Kill all characters on the current line, no matter point is.
18162 +Kill all characters on the current line, no matter where point is.
18163  By default, this is unbound.
18165  @item kill-word (M-d)
18166 @@ -1015,7 +1059,7 @@ Kill from point to the end of the curren
18167  words, to the end of the next word.
18168  Word boundaries are the same as @code{forward-word}.
18170 -@item backward-kill-word (M-DEL)
18171 +@item backward-kill-word (M-@key{DEL})
18172  Kill the word behind point.
18173  Word boundaries are the same as @code{backward-word}.
18175 @@ -1045,21 +1089,20 @@ The word boundaries are the same as @cod
18176  By default, this command is unbound.
18178  @item yank (C-y)
18179 -Yank the top of the kill ring into the buffer at the current
18180 -cursor position.
18181 +Yank the top of the kill ring into the buffer at point.
18183  @item yank-pop (M-y)
18184  Rotate the kill-ring, and yank the new top.  You can only do this if
18185 -the prior command is yank or yank-pop.
18186 +the prior command is @code{yank} or @code{yank-pop}.
18187  @end ftable
18189  @node Numeric Arguments
18190  @subsection Specifying Numeric Arguments
18191  @ftable @code
18193 -@item digit-argument (M-0, M-1, ... M--)
18194 +@item digit-argument (@kbd{M-0}, @kbd{M-1}, @dots{} @kbd{M--})
18195  Add this digit to the argument already accumulating, or start a new
18196 -argument.  @key{M--} starts a negative argument.
18197 +argument.  @kbd{M--} starts a negative argument.
18199  @item universal-argument ()
18200  This is another way to specify an argument.
18201 @@ -1080,13 +1123,9 @@ By default, this is not bound to a key.
18202  @subsection Letting Readline Type For You
18204  @ftable @code
18205 -@item complete (TAB)
18206 -Attempt to do completion on the text before the cursor.  This is
18207 -application-specific.  Generally, if you are typing a filename
18208 -argument, you can do filename completion; if you are typing a command,
18209 -you can do command completion; if you are typing in a symbol to GDB, you
18210 -can do symbol name completion; if you are typing in a variable to Bash,
18211 -you can do variable name completion, and so on.
18212 +@item complete (@key{TAB})
18213 +Attempt to perform completion on the text before point.
18214 +The actual completion performed is application-specific.
18215  @ifset BashFeatures
18216  Bash attempts completion treating the text as a variable (if the
18217  text begins with @samp{$}), username (if the text begins with
18218 @@ -1094,9 +1133,12 @@ text begins with @samp{$}), username (if
18219  command (including aliases and functions) in turn.  If none 
18220  of these produces a match, filename completion is attempted.
18221  @end ifset
18222 +@ifclear BashFeatures
18223 +The default is filename completion.
18224 +@end ifclear
18226  @item possible-completions (M-?)
18227 -List the possible completions of the text before the cursor.
18228 +List the possible completions of the text before point.
18230  @item insert-completions (M-*)
18231  Insert all completions of the text before point that would have
18232 @@ -1107,12 +1149,13 @@ Similar to @code{complete}, but replaces
18233  with a single match from the list of possible completions.
18234  Repeated execution of @code{menu-complete} steps through the list
18235  of possible completions, inserting each match in turn.
18236 -At the end of the list of completions, the bell is rung and the
18237 -original text is restored.
18238 +At the end of the list of completions, the bell is rung
18239 +(subject to the setting of @code{bell-style})
18240 +and the original text is restored.
18241  An argument of @var{n} moves @var{n} positions forward in the list
18242  of matches; a negative argument may be used to move backward
18243  through the list.
18244 -This command is intended to be bound to @code{TAB}, but is unbound
18245 +This command is intended to be bound to @key{TAB}, but is unbound
18246  by default.
18248  @item delete-char-or-list ()
18249 @@ -1165,7 +1208,7 @@ in that order.
18250  List the possible completions of the text before point,
18251  treating it as a command name.
18253 -@item dynamic-complete-history (M-TAB)
18254 +@item dynamic-complete-history (M-@key{TAB})
18255  Attempt completion on the text before point, comparing
18256  the text against lines from the history list for possible
18257  completion matches.
18258 @@ -1212,12 +1255,12 @@ ring the terminal's bell (subject to the
18259  If the metafied character @var{x} is lowercase, run the command
18260  that is bound to the corresponding uppercase character.
18262 -@item prefix-meta (ESC)
18263 -Make the next character typed be metafied.  This is for keyboards
18264 -without a meta key.  Typing @samp{ESC f} is equivalent to typing
18265 -@samp{M-f}.
18266 +@item prefix-meta (@key{ESC})
18267 +Metafy the next character typed.  This is for keyboards
18268 +without a meta key.  Typing @samp{@key{ESC} f} is equivalent to typing
18269 +@kbd{M-f}.
18271 -@item undo (C-_, C-x C-u)
18272 +@item undo (C-_ or C-x C-u)
18273  Incremental undo, separately remembered for each line.
18275  @item revert-line (M-r)
18276 @@ -1233,7 +1276,7 @@ command enough times to get back to the 
18277  Perform tilde expansion on the current word.
18279  @item set-mark (C-@@)
18280 -Set the mark to the current point.  If a
18281 +Set the mark to the point.  If a
18282  numeric argument is supplied, the mark is set to that position.
18284  @item exchange-point-and-mark (C-x C-x)
18285 @@ -1272,7 +1315,7 @@ of an @var{inputrc} file.  This command 
18287  @item dump-macros ()
18288  Print all of the Readline key sequences bound to macros and the
18289 -strings they ouput.  If a numeric argument is supplied,
18290 +strings they output.  If a numeric argument is supplied,
18291  the output is formatted in such a way that it can be made part
18292  of an @var{inputrc} file.  This command is unbound by default.
18294 @@ -1306,7 +1349,7 @@ Perform alias expansion on the current l
18295  @item history-and-alias-expand-line ()
18296  Perform history and alias expansion on the current line.
18298 -@item insert-last-argument (M-., M-_)
18299 +@item insert-last-argument (M-. or M-_)
18300  A synonym for @code{yank-last-arg}.
18302  @item operate-and-get-next (C-o)
18303 @@ -1329,7 +1372,7 @@ been executed.
18304  While the Readline library does not have a full set of @code{vi}
18305  editing functions, it does contain enough to allow simple editing
18306  of the line.  The Readline @code{vi} mode behaves as specified in
18307 -the @sc{POSIX} 1003.2 standard.
18308 +the @sc{posix} 1003.2 standard.
18310  @ifset BashFeatures
18311  In order to switch interactively between @code{emacs} and @code{vi}
18312 @@ -1338,7 +1381,8 @@ commands (@pxref{The Set Builtin}).
18313  @end ifset
18314  @ifclear BashFeatures
18315  In order to switch interactively between @code{emacs} and @code{vi}
18316 -editing modes, use the command M-C-j (toggle-editing-mode).
18317 +editing modes, use the command @kbd{M-C-j} (bound to emacs-editing-mode
18318 +when in @code{vi} mode and to vi-editing-mode in @code{emacs} mode).
18319  @end ifclear
18320  The Readline default is @code{emacs} mode.
18322 @@ -1375,20 +1419,20 @@ described above (@pxref{Commands For Com
18323  First, the actions specified by the compspec are used.
18324  Only matches which are prefixed by the word being completed are
18325  returned.
18326 -When the @samp{-f} or @samp{-d} option is used for filename or
18327 -directory name completion, the shell variable @code{FIGNORE} is
18328 +When the @option{-f} or @option{-d} option is used for filename or
18329 +directory name completion, the shell variable @env{FIGNORE} is
18330  used to filter the matches.
18331 -@xref{Bash Variables}, for a description of @code{FIGNORE}.
18332 +@xref{Bash Variables}, for a description of @env{FIGNORE}.
18334  Any completions specified by a filename expansion pattern to the
18335 -@samp{-G} option are generated next.
18336 +@option{-G} option are generated next.
18337  The words generated by the pattern need not match the word being completed.
18338 -The @code{GLOBIGNORE} shell variable is not used to filter the matches,
18339 -but the @code{FIGNORE} shell variable is used.
18340 +The @env{GLOBIGNORE} shell variable is not used to filter the matches,
18341 +but the @env{FIGNORE} shell variable is used.
18343 -Next, the string specified as the argument to the @samp{-W} option
18344 +Next, the string specified as the argument to the @option{-W} option
18345  is considered.
18346 -The string is first split using the characters in the @code{IFS}
18347 +The string is first split using the characters in the @env{IFS}
18348  special variable as delimiters.
18349  Shell quoting is honored.
18350  Each word is then expanded using
18351 @@ -1401,12 +1445,12 @@ The results of the expansion are prefix-
18352  completed, and the matching words become the possible completions.
18354  After these matches have been generated, any shell function or command
18355 -specified with the @samp{-F} and @samp{-C} options is invoked.
18356 -When the command or function is invoked, the @code{COMP_LINE} and
18357 -@code{COMP_POINT} variables are assigned values as described above
18358 +specified with the @option{-F} and @option{-C} options is invoked.
18359 +When the command or function is invoked, the @env{COMP_LINE} and
18360 +@env{COMP_POINT} variables are assigned values as described above
18361  (@pxref{Bash Variables}).
18362 -If a shell function is being invoked, the @code{COMP_WORDS} and
18363 -@code{COMP_CWORD} variables are also set.
18364 +If a shell function is being invoked, the @env{COMP_WORDS} and
18365 +@env{COMP_CWORD} variables are also set.
18366  When the function or command is invoked, the first argument is the
18367  name of the command whose arguments are being completed, the
18368  second argument is the word being completed, and the third argument
18369 @@ -1415,21 +1459,21 @@ No filtering of the generated completion
18370  is performed; the function or command has complete freedom in generating
18371  the matches.
18373 -Any function specified with @samp{-F} is invoked first.
18374 +Any function specified with @option{-F} is invoked first.
18375  The function may use any of the shell facilities, including the
18376  @code{compgen} builtin described below
18377  (@pxref{Programmable Completion Builtins}), to generate the matches.
18378 -It must put the possible completions in the @code{COMPREPLY} array
18379 +It must put the possible completions in the @env{COMPREPLY} array
18380  variable.
18382 -Next, any command specified with the @samp{-C} option is invoked
18383 +Next, any command specified with the @option{-C} option is invoked
18384  in an environment equivalent to command substitution.
18385  It should print a list of completions, one per line, to
18386  the standard output.
18387  Backslash may be used to escape a newline, if necessary.
18389  After all of the possible completions are generated, any filter
18390 -specified with the @samp{-X} option is applied to the list.
18391 +specified with the @option{-X} option is applied to the list.
18392  The filter is a pattern as used for pathname expansion; a @samp{&}
18393  in the pattern is replaced with the text of the word being completed.
18394  A literal @samp{&} may be escaped with a backslash; the backslash
18395 @@ -1438,15 +1482,22 @@ Any completion that matches the pattern 
18396  A leading @samp{!} negates the pattern; in this case any completion
18397  not matching the pattern will be removed.
18399 -Finally, any prefix and suffix specified with the @samp{-P} and @samp{-S}
18400 +Finally, any prefix and suffix specified with the @option{-P} and @option{-S}
18401  options are added to each member of the completion list, and the result is
18402  returned to the Readline completion code as the list of possible
18403  completions.
18405 -If a compspec is found, whatever it generates is returned to the completion
18406 -code as the full set of possible completions.
18407 -The default Bash completions are not attempted, and the Readline
18408 -default of filename completion is disabled.
18409 +If the previously-applied actions do not generate any matches, and the
18410 +@option{-o dirnames} option was supplied to @code{complete} when the
18411 +compspec was defined, directory name completion is attempted. 
18413 +By default, if a compspec is found, whatever it generates is returned to
18414 +the completion code as the full set of possible completions.
18415 +The default Bash completions are not attempted, and the Readline default
18416 +of filename completion is disabled.
18417 +If the @option{-o default} option was supplied to @code{complete} when the
18418 +compspec was defined, Readline's default completion will be performed
18419 +if the compspec generates no matches.
18421  @node Programmable Completion Builtins
18422  @section Programmable Completion Builtins
18423 @@ -1465,9 +1516,9 @@ facilities.
18424  Generate possible completion matches for @var{word} according to
18425  the @var{option}s, which may be any option accepted by the
18426  @code{complete}
18427 -builtin with the exception of @samp{-p} and @samp{-r}, and write
18428 +builtin with the exception of @option{-p} and @option{-r}, and write
18429  the matches to the standard output.
18430 -When using the @samp{-F} or @samp{-C} options, the various shell variables
18431 +When using the @option{-F} or @option{-C} options, the various shell variables
18432  set by the programmable completion facilities, while available, will not
18433  have useful values.
18435 @@ -1483,17 +1534,17 @@ matches were generated.
18436  @item complete
18437  @btindex complete
18438  @example
18439 -@code{complete [-abcdefjkvu] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
18440 +@code{complete [-abcdefjkvu] [-o @var{comp-option}] [-A @var{action}] [-G @var{globpat}] [-W @var{wordlist}]
18441  [-P @var{prefix}] [-S @var{suffix}] [-X @var{filterpat}] [-F @var{function}]
18442  [-C @var{command}] @var{name} [@var{name} @dots{}]}
18443  @code{complete -pr [@var{name} @dots{}]}
18444  @end example
18446  Specify how arguments to each @var{name} should be completed.
18447 -If the @samp{-p} option is supplied, or if no options are supplied, existing
18448 +If the @option{-p} option is supplied, or if no options are supplied, existing
18449  completion specifications are printed in a way that allows them to be
18450  reused as input.
18451 -The @samp{-r} option removes a completion specification for
18452 +The @option{-r} option removes a completion specification for
18453  each @var{name}, or, if no @var{name}s are supplied, all
18454  completion specifications.
18456 @@ -1501,19 +1552,40 @@ The process of applying these completion
18457  is attempted is described above (@pxref{Programmable Completion}).
18459  Other options, if specified, have the following meanings.
18460 -The arguments to the @samp{-G}, @samp{-W}, and @samp{-X} options
18461 -(and, if necessary, the @samp{-P} and @samp{-S} options)
18462 +The arguments to the @option{-G}, @option{-W}, and @option{-X} options
18463 +(and, if necessary, the @option{-P} and @option{-S} options)
18464  should be quoted to protect them from expansion before the
18465  @code{complete} builtin is invoked.
18468 +@table @code
18469 +@item -o @var{comp-option}
18470 +The @var{comp-option} controls several aspects of the compspec's behavior
18471 +beyond the simple generation of completions.
18472 +@var{comp-option} may be one of: 
18474  @table @code
18476 +@item default
18477 +Use readline's default completion if the compspec generates no matches.
18479 +@item dirnames
18480 +Perform directory name completion if the compspec generates no matches.
18482 +@item filenames
18483 +Tell Readline that the compspec generates filenames, so it can perform any
18484 +filename\-specific processing (like adding a slash to directory names or
18485 +suppressing trailing spaces).  This option is intended to be used with
18486 +shell functions specified with @option{-F}.
18487 +@end table
18489  @item -A @var{action}
18490  The @var{action} may be one of the following to generate a list of possible
18491  completions:
18493  @table @code
18494  @item alias
18495 -Alias names.  May also be specified as @samp{-a}.
18496 +Alias names.  May also be specified as @option{-a}.
18498  @item arrayvar
18499  Array variable names.
18500 @@ -1522,13 +1594,13 @@ Array variable names.
18501  Readline key binding names (@pxref{Bindable Readline Commands}).
18503  @item builtin
18504 -Names of shell builtin commands.  May also be specified as @samp{-b}.
18505 +Names of shell builtin commands.  May also be specified as @option{-b}.
18507  @item command
18508 -Command names.  May also be specified as @samp{-c}.
18509 +Command names.  May also be specified as @option{-c}.
18511  @item directory
18512 -Directory names.  May also be specified as @samp{-d}.
18513 +Directory names.  May also be specified as @option{-d}.
18515  @item disabled
18516  Names of disabled shell builtins.
18517 @@ -1537,10 +1609,10 @@ Names of disabled shell builtins.
18518  Names of enabled shell builtins.
18520  @item export
18521 -Names of exported shell variables.  May also be specified as @samp{-e}.
18522 +Names of exported shell variables.  May also be specified as @option{-e}.
18524  @item file
18525 -File names.  May also be specified as @samp{-f}.
18526 +File names.  May also be specified as @option{-f}.
18528  @item function
18529  Names of shell functions.
18530 @@ -1550,19 +1622,19 @@ Help topics as accepted by the @code{hel
18532  @item hostname
18533  Hostnames, as taken from the file specified by the
18534 -@code{HOSTFILE} shell variable (@pxref{Bash Variables}).
18535 +@env{HOSTFILE} shell variable (@pxref{Bash Variables}).
18537  @item job
18538 -Job names, if job control is active.  May also be specified as @samp{-j}.
18539 +Job names, if job control is active.  May also be specified as @option{-j}.
18541  @item keyword
18542 -Shell reserved words.  May also be specified as @samp{-k}.
18543 +Shell reserved words.  May also be specified as @option{-k}.
18545  @item running
18546  Names of running jobs, if job control is active.
18548  @item setopt
18549 -Valid arguments for the @samp{-o} option to the @code{set} builtin
18550 +Valid arguments for the @option{-o} option to the @code{set} builtin
18551  (@pxref{The Set Builtin}).
18553  @item shopt
18554 @@ -1576,10 +1648,10 @@ Signal names.
18555  Names of stopped jobs, if job control is active.
18557  @item user
18558 -User names.  May also be specified as @samp{-u}.
18559 +User names.  May also be specified as @option{-u}.
18561  @item variable
18562 -Names of all shell variables.  May also be specified as @samp{-v}.
18563 +Names of all shell variables.  May also be specified as @option{-v}.
18564  @end table
18566  @item -G @var{globpat}
18567 @@ -1588,7 +1660,7 @@ the possible completions.
18569  @item -W @var{wordlist}
18570  The @var{wordlist} is split using the characters in the
18571 -@code{IFS} special variable as delimiters, and each resultant word
18572 +@env{IFS} special variable as delimiters, and each resultant word
18573  is expanded.
18574  The possible completions are the members of the resultant list which
18575  match the word being completed.
18576 @@ -1601,7 +1673,7 @@ used as the possible completions.
18577  The shell function @var{function} is executed in the current shell
18578  environment.
18579  When it finishes, the possible completions are retrieved from the value
18580 -of the @code{COMPREPLY} array variable.
18581 +of the @env{COMPREPLY} array variable.
18583  @item -X @var{filterpat}
18584  @var{filterpat} is a pattern as used for filename expansion.
18585 @@ -1621,7 +1693,7 @@ after all other options have been applie
18586  @end table
18588  The return value is true unless an invalid option is supplied, an option
18589 -other than @samp{-p} or @samp{-r} is supplied without a @var{name}
18590 +other than @option{-p} or @option{-r} is supplied without a @var{name}
18591  argument, an attempt is made to remove a completion specification for
18592  a @var{name} for which no specification exists, or
18593  an error occurs adding a completion specification.
18594 Index: readline/doc/rluserman.texinfo
18595 ===================================================================
18596 RCS file: /prjz/.cvsroot/gdb/readline/doc/rluserman.texinfo,v
18597 retrieving revision 1.1.1.1
18598 diff -u -3 -p -r1.1.1.1 rluserman.texinfo
18599 --- readline/doc/rluserman.texinfo      2003/02/16 21:36:34     1.1.1.1
18600 +++ readline/doc/rluserman.texinfo      2001/02/02 16:59:01
18601 @@ -10,14 +10,14 @@
18602  @ifinfo
18603  @dircategory Libraries
18604  @direntry
18605 -* Readline: (readline).       The GNU readline library API
18606 +* RLuserman: (rluserman).       The GNU readline library User's Manual.
18607  @end direntry
18609  This document describes the end user interface of the GNU Readline Library,
18610  a utility which aids in the consistency of user interface across discrete
18611  programs that need to provide a command line interface.
18613 -Copyright (C) 1988-1999 Free Software Foundation, Inc.
18614 +Copyright (C) 1988-2001 Free Software Foundation, Inc.
18616  Permission is granted to make and distribute verbatim copies of
18617  this manual provided the copyright notice and this permission notice
18618 @@ -72,7 +72,7 @@ except that this permission notice may b
18619  by the Free Software Foundation.
18621  @vskip 0pt plus 1filll
18622 -Copyright @copyright{} 1988-1999 Free Software Foundation, Inc.
18623 +Copyright @copyright{} 1988-2001 Free Software Foundation, Inc.
18624  @end titlepage
18626  @ifinfo
18627 Index: readline/doc/texi2dvi
18628 ===================================================================
18629 RCS file: /prjz/.cvsroot/gdb/readline/doc/texi2dvi,v
18630 retrieving revision 1.1.1.1
18631 diff -u -3 -p -r1.1.1.1 texi2dvi
18632 --- readline/doc/texi2dvi       2003/02/16 21:36:34     1.1.1.1
18633 +++ readline/doc/texi2dvi       1998/04/27 16:00:44
18634 @@ -1,6 +1,6 @@
18635  #! /bin/sh
18636  # texi2dvi --- smartly produce DVI files from texinfo sources
18637 -# $Id: texi2dvi,v 1.1.1.1 2003/02/16 21:36:34 BoydE Exp $
18638 +# $Id: texi2dvi,v 0.8 1998/02/26 21:13:13 karl Exp $
18640  # Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
18642 @@ -45,7 +45,7 @@
18643  progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
18645  # This string is expanded by rcs automatically when this file is checked out.
18646 -rcs_revision='$Revision: 1.1.1.1 $'
18647 +rcs_revision='$Revision: 0.8 $'
18648  version=`set - $rcs_revision; echo $2`
18650  # To prevent hairy quoting and escaping later.
18651 Index: readline/examples/Makefile.in
18652 ===================================================================
18653 RCS file: /prjz/.cvsroot/gdb/readline/examples/Makefile.in,v
18654 retrieving revision 1.1.1.1
18655 diff -u -3 -p -r1.1.1.1 Makefile.in
18656 --- readline/examples/Makefile.in       2003/02/16 21:36:34     1.1.1.1
18657 +++ readline/examples/Makefile.in       2001/04/02 18:27:34
18658 @@ -16,6 +16,7 @@
18659  # You should have received a copy of the GNU General Public License
18660  # along with this program; if not, write to the Free Software
18661  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
18662 +RL_LIBRARY_VERSION = @LIBVERSION@
18664  SHELL = @MAKE_SHELL@
18665  RM = rm -f
18666 @@ -28,7 +29,7 @@ BUILD_DIR = .
18667  DEFS = @DEFS@
18668  CC = @CC@
18669  CFLAGS = @CFLAGS@
18670 -LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DREADLINE_LIBRARY
18671 +LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DREADLINE_LIBRARY -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"'
18672  CPPFLAGS = @CPPFLAGS@
18674  INCLUDES = -I$(srcdir) -I$(top_srcdir) -I..
18675 @@ -45,10 +46,11 @@ TERMCAP_LIB = @TERMCAP_LIB@
18676         ${RM} $@
18677         $(CC) $(CCFLAGS) -c $<
18679 -EXECUTABLES = fileman rltest rl rlversion
18680 -OBJECTS = fileman.o rltest.o rl.o rlversion.o
18681 +EXECUTABLES = fileman rltest rl rlversion histexamp
18682 +OBJECTS = fileman.o rltest.o rl.o rlversion.o histexamp.o
18684  all: $(EXECUTABLES)
18685 +everything: all rlfe
18687  rl: rl.o
18688         $(CC) $(LDFLAGS) -o $@ rl.o -lreadline $(TERMCAP_LIB)
18689 @@ -62,9 +64,13 @@ rltest: rltest.o
18690  rlversion: rlversion.o $(READLINE_LIB)
18691         $(CC) $(LDFLAGS) -o $@ rlversion.o -lreadline $(TERMCAP_LIB)
18693 +histexamp: histexamp.o $(HISTORY_LIB)
18694 +       $(CC) $(LDFLAGS) -o $@ histexamp.o -lhistory $(TERMCAP_LIB)
18696  clean mostlyclean:
18697         $(RM) $(OBJECTS)
18698         $(RM) $(EXECUTABLES) *.exe
18699 +       $(RM) rlfe.o rlfe
18701  distclean maintainer-clean: clean
18702         $(RM) Makefile
18703 @@ -73,6 +79,13 @@ fileman.o: fileman.c
18704  rltest.o: rltest.c
18705  rl.o: rl.c
18706  rlversion.o: rlversion.c
18707 +histexamp.o: histexamp.c
18709 +fileman.o: $(top_srcdir)/readline.h
18710 +rltest.o: $(top_srcdir)/readline.h
18711 +rl.o: $(top_srcdir)/readline.h
18712 +rlversion.o: $(top_srcdir)/readline.h
18713 +histexamp.o: $(top_srcdir)/history.h
18715  # Stuff for Per Bothner's `rlfe' program
18716   
18717 Index: readline/examples/excallback.c
18718 ===================================================================
18719 RCS file: /prjz/.cvsroot/gdb/readline/examples/excallback.c,v
18720 retrieving revision 1.1.1.1
18721 diff -u -3 -p -r1.1.1.1 excallback.c
18722 --- readline/examples/excallback.c      2003/02/16 21:36:34     1.1.1.1
18723 +++ readline/examples/excallback.c      2000/07/10 14:52:46
18724 @@ -153,6 +153,8 @@ process_line(char *line)
18725    } else {
18726      fprintf(stderr, "|%s|\n", line);
18727    }
18729 +  free (line);
18732  int
18733 Index: readline/examples/fileman.c
18734 ===================================================================
18735 RCS file: /prjz/.cvsroot/gdb/readline/examples/fileman.c,v
18736 retrieving revision 1.1.1.1
18737 diff -u -3 -p -r1.1.1.1 fileman.c
18738 --- readline/examples/fileman.c 2003/02/16 21:36:34     1.1.1.1
18739 +++ readline/examples/fileman.c 2003/02/17 12:47:09
18740 @@ -41,15 +41,22 @@
18741  extern char *xmalloc ();
18743  /* The names of functions that actually do the manipulation. */
18744 -int com_list (), com_view (), com_rename (), com_stat (), com_pwd ();
18745 -int com_delete (), com_help (), com_cd (), com_quit ();
18746 +int com_list __P((char *));
18747 +int com_view __P((char *));
18748 +int com_rename __P((char *));
18749 +int com_stat __P((char *));
18750 +int com_pwd __P((char *));
18751 +int com_delete __P((char *));
18752 +int com_help __P((char *));
18753 +int com_cd __P((char *));
18754 +int com_quit __P((char *));
18756  /* A structure which contains information on the commands this program
18757     can understand. */
18759  typedef struct {
18760    char *name;                  /* User printable name of the function. */
18761 -  Function *func;              /* Function to call to do the job. */
18762 +  rl_icpfunc_t *func;          /* Function to call to do the job. */
18763    char *doc;                   /* Documentation for this function.  */
18764  } COMMAND;
18766 @@ -65,7 +72,7 @@ COMMAND commands[] = {
18767    { "rename", com_rename, "Rename FILE to NEWNAME" },
18768    { "stat", com_stat, "Print out statistics on FILE" },
18769    { "view", com_view, "View the contents of FILE" },
18770 -  { (char *)NULL, (Function *)NULL, (char *)NULL }
18771 +  { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
18772  };
18774  /* Forward declarations. */
18775 @@ -205,8 +212,8 @@ stripwhite (string)
18776  /*                                                                  */
18777  /* **************************************************************** */
18779 -char *command_generator ();
18780 -char **fileman_completion ();
18781 +char *command_generator __P((const char *, int));
18782 +char **fileman_completion __P((const char *, int, int));
18784  /* Tell the GNU Readline library how to complete.  We want to try to complete
18785     on command names if this is the first word in the line, or on filenames
18786 @@ -217,7 +224,7 @@ initialize_readline ()
18787    rl_readline_name = "FileMan";
18789    /* Tell the completer that we want a crack first. */
18790 -  rl_attempted_completion_function = (CPPFunction *)fileman_completion;
18791 +  rl_attempted_completion_function = fileman_completion;
18794  /* Attempt to complete on the contents of TEXT.  START and END bound the
18795 @@ -227,7 +234,7 @@ initialize_readline ()
18796     or NULL if there aren't any. */
18797  char **
18798  fileman_completion (text, start, end)
18799 -     char *text;
18800 +     const char *text;
18801       int start, end;
18803    char **matches;
18804 @@ -238,7 +245,7 @@ fileman_completion (text, start, end)
18805       to complete.  Otherwise it is the name of a file in the current
18806       directory. */
18807    if (start == 0)
18808 -    matches = completion_matches (text, command_generator);
18809 +    matches = rl_completion_matches (text, command_generator);
18811    return (matches);
18813 @@ -248,7 +255,7 @@ fileman_completion (text, start, end)
18814     start at the top of the list. */
18815  char *
18816  command_generator (text, state)
18817 -     char *text;
18818 +     const char *text;
18819       int state;
18821    static int list_index, len;
18822 @@ -292,8 +299,11 @@ com_list (arg)
18824    if (!arg)
18825      arg = "";
18827 +#ifdef __MSDOS__
18828 +  sprintf (syscom, "dir %s", arg);
18829 +#else
18830    sprintf (syscom, "ls -FClg %s", arg);
18831 +#endif
18832    return (system (syscom));
18835 Index: readline/examples/histexamp.c
18836 ===================================================================
18837 RCS file: /prjz/.cvsroot/gdb/readline/examples/histexamp.c,v
18838 retrieving revision 1.1.1.1
18839 diff -u -3 -p -r1.1.1.1 histexamp.c
18840 --- readline/examples/histexamp.c       2003/02/16 21:36:34     1.1.1.1
18841 +++ readline/examples/histexamp.c       2001/02/06 15:35:21
18842 @@ -1,4 +1,14 @@
18843 -main ()
18844 +#include <stdio.h>
18846 +#ifdef READLINE_LIBRARY
18847 +#  include "history.h"
18848 +#else
18849 +#  include <readline/history.h>
18850 +#endif
18852 +main (argc, argv)
18853 +     int argc;
18854 +     char **argv;
18856    char line[1024], *t;
18857    int len, done = 0;
18858 Index: readline/examples/manexamp.c
18859 ===================================================================
18860 RCS file: /prjz/.cvsroot/gdb/readline/examples/manexamp.c,v
18861 retrieving revision 1.1.1.1
18862 diff -u -3 -p -r1.1.1.1 manexamp.c
18863 --- readline/examples/manexamp.c        2003/02/16 21:36:34     1.1.1.1
18864 +++ readline/examples/manexamp.c        2001/02/02 17:14:15
18865 @@ -3,10 +3,9 @@
18866  #include <stdio.h>
18867  #include <readline/readline.h>
18870  /* **************************************************************** */
18871  /*                                                                  */
18872 -*                      How to Emulate gets ()                      */
18873 +/*                     How to Emulate gets ()                      */
18874  /*                                                                  */
18875  /* **************************************************************** */
18877 @@ -82,13 +81,12 @@ invert_case_line (count, key)
18879    for (; start != end; start += direction)
18880      {
18881 -      if (uppercase_p (rl_line_buffer[start]))
18882 -       rl_line_buffer[start] = to_lower (rl_line_buffer[start]);
18883 -      else if (lowercase_p (rl_line_buffer[start]))
18884 -       rl_line_buffer[start] = to_upper (rl_line_buffer[start]);
18885 +      if (_rl_uppercase_p (rl_line_buffer[start]))
18886 +       rl_line_buffer[start] = _rl_to_lower (rl_line_buffer[start]);
18887 +      else if (_rl_lowercase_p (rl_line_buffer[start]))
18888 +       rl_line_buffer[start] = _rl_to_upper (rl_line_buffer[start]);
18889      }
18891    /* Move point to on top of the last character changed. */
18892    rl_point = end - direction;
18895 Index: readline/examples/rl.c
18896 ===================================================================
18897 RCS file: /prjz/.cvsroot/gdb/readline/examples/rl.c,v
18898 retrieving revision 1.1.1.1
18899 diff -u -3 -p -r1.1.1.1 rl.c
18900 --- readline/examples/rl.c      2003/02/16 21:36:34     1.1.1.1
18901 +++ readline/examples/rl.c      2000/11/01 19:04:30
18902 @@ -38,7 +38,7 @@ set_deftext ()
18903      {
18904        rl_insert_text (deftext);
18905        deftext = (char *)NULL;
18906 -      rl_startup_hook = (Function *)NULL;
18907 +      rl_startup_hook = (rl_hook_func_t *)NULL;
18908      }
18909    return 0;
18911 @@ -126,6 +126,6 @@ main (argc, argv)
18912    if (temp == 0)
18913      exit (1);
18915 -  puts (temp);
18916 +  printf ("%s\n", temp);
18917    exit (0);
18919 Index: readline/examples/rlfe.c
18920 ===================================================================
18921 RCS file: /prjz/.cvsroot/gdb/readline/examples/rlfe.c,v
18922 retrieving revision 1.1.1.1
18923 diff -u -3 -p -r1.1.1.1 rlfe.c
18924 --- readline/examples/rlfe.c    2003/02/16 21:36:34     1.1.1.1
18925 +++ readline/examples/rlfe.c    2000/11/17 21:16:24
18926 @@ -64,6 +64,8 @@
18927  #include <unistd.h>
18928  #include <sys/ioctl.h>
18929  #include <termios.h>
18930 +#include <limits.h>
18931 +#include <dirent.h>
18933  #ifdef READLINE_LIBRARY
18934  #  include "readline.h"
18935 @@ -81,6 +83,7 @@
18936  #endif
18938  #ifndef HAVE_MEMMOVE
18939 +#ifndef memmove
18940  #  if __GNUC__ > 1
18941  #    define memmove(d, s, n)   __builtin_memcpy(d, s, n)
18942  #  else
18943 @@ -89,9 +92,20 @@
18944  #else
18945  #  define memmove(d, s, n)     memcpy(d, s, n)
18946  #endif
18947 +#endif
18949 +#define APPLICATION_NAME "Rlfe"
18951 +#ifndef errno
18952 +extern int errno;
18953 +#endif
18955 -#define APPLICATION_NAME "Fep"
18956 +extern int optind;
18957 +extern char *optarg;
18959 +static char *progname;
18960 +static char *progversion;
18962  static int in_from_inferior_fd;
18963  static int out_to_inferior_fd;
18965 @@ -109,14 +123,16 @@ static int out_to_inferior_fd;
18966  char echo_suppress_buffer[ECHO_SUPPRESS_MAX];
18967  int echo_suppress_start = 0;
18968  int echo_suppress_limit = 0;
18970 +/* #define DEBUG */
18972 -#define DEBUG
18973 +static FILE *logfile = NULL;
18975  #ifdef DEBUG
18976 -FILE *logfile = NULL;
18977 -#define DPRINT0(FMT) (fprintf(logfile, FMT), fflush(logfile))
18978 -#define DPRINT1(FMT, V1) (fprintf(logfile, FMT, V1), fflush(logfile))
18979 -#define DPRINT2(FMT, V1, V2) (fprintf(logfile, FMT, V1, V2), fflush(logfile))
18980 +FILE *debugfile = NULL;
18981 +#define DPRINT0(FMT) (fprintf(debugfile, FMT), fflush(debugfile))
18982 +#define DPRINT1(FMT, V1) (fprintf(debugfile, FMT, V1), fflush(debugfile))
18983 +#define DPRINT2(FMT, V1, V2) (fprintf(debugfile, FMT, V1, V2), fflush(debugfile))
18984  #else
18985  #define DPRINT0(FMT) /* Do nothing */
18986  #define DPRINT1(FMT, V1) /* Do nothing */
18987 @@ -125,6 +141,10 @@ FILE *logfile = NULL;
18989  struct termios orig_term;
18991 +static int rlfe_directory_completion_hook __P((char **));
18992 +static int rlfe_directory_rewrite_hook __P((char **));
18993 +static char *rlfe_filename_completion_function __P((const char *, int));
18995  /* Pid of child process. */
18996  static pid_t child = -1;
18998 @@ -370,13 +390,20 @@ my_rl_getc (FILE *dummy)
18999    return ch;
19002 +static void
19003 +usage()
19005 +  fprintf (stderr, "%s: usage: %s [-l filename] [-a] [-n appname] [-hv] [command [arguments...]]\n",
19006 +                  progname, progname);
19009  int
19010  main(int argc, char** argv)
19012    char *path;
19013 -  int i;
19014 +  int i, append;
19015    int master;
19016 -  char *name;
19017 +  char *name, *logfname, *appname;
19018    int in_from_tty_fd;
19019    struct sigaction act;
19020    struct winsize ws;
19021 @@ -387,12 +414,58 @@ main(int argc, char** argv)
19022    char *prompt = empty_string;
19023    int ioctl_err = 0;
19025 +  if ((progname = strrchr (argv[0], '/')) == 0)
19026 +    progname = argv[0];
19027 +  else
19028 +    progname++;
19029 +  progversion = RL_LIBRARY_VERSION;
19031 +  append = 0;
19032 +  appname = APPLICATION_NAME;
19033 +  logfname = (char *)NULL;
19035 +  while ((i = getopt (argc, argv, "ahl:n:v")) != EOF)
19036 +    {
19037 +      switch (i)
19038 +       {
19039 +       case 'l':
19040 +         logfname = optarg;
19041 +         break;
19042 +       case 'n':
19043 +         appname = optarg;
19044 +         break;
19045 +       case 'a':
19046 +         append = 1;
19047 +         break;
19048 +       case 'h':
19049 +         usage ();
19050 +         exit (0);
19051 +       case 'v':
19052 +         fprintf (stderr, "%s version %s\n", progname, progversion);
19053 +         exit (0);
19054 +       default:
19055 +         usage ();
19056 +         exit (2);
19057 +       }
19058 +    }
19060 +  argc -= optind;
19061 +  argv += optind;
19063 +  if (logfname)
19064 +    {
19065 +      logfile = fopen (logfname, append ? "a" : "w");
19066 +      if (logfile == 0)
19067 +       fprintf (stderr, "%s: warning: could not open log file %s: %s\n",
19068 +                        progname, logfname, strerror (errno));
19069 +    }
19070 +    
19071 +  rl_readline_name = appname;
19072 +  
19073  #ifdef DEBUG
19074 -  logfile = fopen("LOG", "w");
19075 +  debugfile = fopen("LOG", "w");
19076  #endif
19078 -  rl_readline_name = APPLICATION_NAME;
19079 -  
19080    if ((master = get_master_pty(&name)) < 0)
19081      {
19082        perror("ptypair: could not open master pty");
19083 @@ -486,10 +559,10 @@ main(int argc, char** argv)
19084        /* now start the shell */
19085        {
19086         static char* command_args[] = { COMMAND_ARGS, NULL };
19087 -       if (argc <= 1)
19088 +       if (argc < 1)
19089           execvp(COMMAND, command_args);
19090         else
19091 -         execvp(argv[1], &argv[1]);
19092 +         execvp(argv[0], &argv[0]);
19093        }
19095        /* should never be reached */
19096 @@ -535,6 +608,13 @@ main(int argc, char** argv)
19097    rl_deprep_term_function = null_deprep_terminal; 
19098    rl_callback_handler_install (prompt, line_handler);
19100 +#if 1
19101 +  rl_directory_completion_hook = rlfe_directory_completion_hook;
19102 +  rl_completion_entry_function = rlfe_filename_completion_function;
19103 +#else
19104 +  rl_directory_rewrite_hook = rlfe_directory_rewrite_hook;
19105 +#endif
19107    in_from_tty_fd = STDIN_FILENO;
19108    FD_ZERO (&in_set);
19109    maxfd = in_from_inferior_fd > in_from_tty_fd ? in_from_inferior_fd
19110 @@ -644,6 +724,47 @@ main(int argc, char** argv)
19111             }
19112           old_count = buf_count;
19114 +         /* Do some minimal carriage return translation and backspace
19115 +            processing before logging the input line. */
19116 +         if (logfile)
19117 +           {
19118 +#ifndef __GNUC__
19119 +             char *b;
19120 +#else
19121 +             char b[count + 1];
19122 +#endif
19123 +             int i, j;
19125 +#ifndef __GNUC__
19126 +             b = malloc (count + 1);
19127 +             if (b) {
19128 +#endif
19129 +             for (i = 0; i < count; i++)
19130 +               b[i] = buf[buf_count + i];
19131 +             b[i] = '\0';
19132 +             for (i = j = 0; i <= count; i++)
19133 +               {
19134 +                 if (b[i] == '\r')
19135 +                   {
19136 +                     if (b[i+1] != '\n')
19137 +                       b[j++] = '\n';
19138 +                   }
19139 +                 else if (b[i] == '\b')
19140 +                   {
19141 +                     if (i)
19142 +                       j--;
19143 +                   }
19144 +                 else
19145 +                   b[j++] = b[i];
19146 +               }
19147 +             fprintf (logfile, "%s", b);
19149 +#ifndef __GNUC__
19150 +             free (b);
19151 +             }
19152 +#endif
19153 +           }
19155            /* Look for any pending echo that we need to suppress. */
19156           while (echo_suppress_start < echo_suppress_limit
19157                  && count > 0
19158 @@ -682,4 +803,240 @@ main(int argc, char** argv)
19159           DPRINT2("-> i: %d, buf_count: %d\n", i, buf_count);
19160         }
19161      }
19165 + *
19166 + * FILENAME COMPLETION FOR RLFE
19167 + *
19168 + */
19170 +#ifndef PATH_MAX
19171 +#  define PATH_MAX 1024
19172 +#endif
19174 +#define DIRSEP         '/'
19175 +#define ISDIRSEP(x)    ((x) == '/')
19176 +#define PATHSEP(x)     (ISDIRSEP(x) || (x) == 0)
19178 +#define DOT_OR_DOTDOT(x) \
19179 +       ((x)[0] == '.' && (PATHSEP((x)[1]) || \
19180 +                         ((x)[1] == '.' && PATHSEP((x)[2]))))
19182 +#define FREE(x)                if (x) free(x)
19184 +#define STRDUP(s, x)   do { \
19185 +                         s = strdup (x);\
19186 +                         if (s == 0) \
19187 +                           return ((char *)NULL); \
19188 +                       } while (0)
19190 +static int
19191 +get_inferior_cwd (path, psize)
19192 +     char *path;
19193 +     size_t psize;
19195 +  int n;
19196 +  static char procfsbuf[PATH_MAX] = { '\0' };
19198 +  if (procfsbuf[0] == '\0')
19199 +    sprintf (procfsbuf, "/proc/%d/cwd", (int)child);
19200 +  n = readlink (procfsbuf, path, psize);
19201 +  if (n < 0)
19202 +    return n;
19203 +  if (n > psize)
19204 +    return -1;
19205 +  path[n] = '\0';
19206 +  return n;
19209 +static int
19210 +rlfe_directory_rewrite_hook (dirnamep)
19211 +     char **dirnamep;
19213 +  char *ldirname, cwd[PATH_MAX], *retdir, *ld;
19214 +  int n, ldlen;
19216 +  ldirname = *dirnamep;
19218 +  if (*ldirname == '/')
19219 +    return 0;
19221 +  n = get_inferior_cwd (cwd, sizeof(cwd) - 1);
19222 +  if (n < 0)
19223 +    return 0;
19224 +  if (n == 0)  /* current directory */
19225 +    {
19226 +      cwd[0] = '.';
19227 +      cwd[1] = '\0';
19228 +      n = 1;
19229 +    }
19231 +  /* Minimally canonicalize ldirname by removing leading `./' */
19232 +  for (ld = ldirname; *ld; )
19233 +    {
19234 +      if (ISDIRSEP (ld[0]))
19235 +       ld++;
19236 +      else if (ld[0] == '.' && PATHSEP(ld[1]))
19237 +       ld++;
19238 +      else
19239 +       break;
19240 +    }
19241 +  ldlen = (ld && *ld) ? strlen (ld) : 0;
19243 +  retdir = (char *)malloc (n + ldlen + 3);
19244 +  if (retdir == 0)
19245 +    return 0;
19246 +  if (ldlen)
19247 +    sprintf (retdir, "%s/%s", cwd, ld);
19248 +  else
19249 +    strcpy (retdir, cwd);
19250 +  free (ldirname);
19252 +  *dirnamep = retdir;
19254 +  DPRINT1("rl_directory_rewrite_hook returns %s\n", retdir);
19255 +  return 1;
19258 +/* Translate *DIRNAMEP to be relative to the inferior's CWD.  Leave a trailing
19259 +   slash on the result. */
19260 +static int
19261 +rlfe_directory_completion_hook (dirnamep)
19262 +     char **dirnamep;
19264 +  char *ldirname, *retdir;
19265 +  int n, ldlen;
19267 +  ldirname = *dirnamep;
19269 +  if (*ldirname == '/')
19270 +    return 0;
19272 +  n = rlfe_directory_rewrite_hook (dirnamep);
19273 +  if (n == 0)
19274 +    return 0;
19276 +  ldirname = *dirnamep;
19277 +  ldlen = (ldirname && *ldirname) ? strlen (ldirname) : 0;
19279 +  if (ldlen == 0 || ldirname[ldlen - 1] != '/')
19280 +    {
19281 +      retdir = (char *)malloc (ldlen + 3);
19282 +      if (retdir == 0)
19283 +       return 0;
19284 +      if (ldlen)
19285 +       strcpy (retdir, ldirname);
19286 +      else
19287 +       retdir[ldlen++] = '.';
19288 +      retdir[ldlen] = '/';
19289 +      retdir[ldlen+1] = '\0';
19290 +      free (ldirname);
19292 +      *dirnamep = retdir;
19293 +    }
19295 +  DPRINT1("rl_directory_completion_hook returns %s\n", retdir);
19296 +  return 1;
19299 +static char *
19300 +rlfe_filename_completion_function (text, state)
19301 +     const char *text;
19302 +     int state;
19304 +  static DIR *directory;
19305 +  static char *filename = (char *)NULL;
19306 +  static char *dirname = (char *)NULL, *ud = (char *)NULL;
19307 +  static int flen, udlen;
19308 +  char *temp;
19309 +  struct dirent *dentry;
19311 +  if (state == 0)
19312 +    {
19313 +      if (directory)
19314 +       {
19315 +         closedir (directory);
19316 +         directory = 0;
19317 +       }
19318 +      FREE (dirname);
19319 +      FREE (filename);
19320 +      FREE (ud);
19322 +      if (text && *text)
19323 +        STRDUP (filename, text);
19324 +      else
19325 +       {
19326 +         filename = malloc(1); 
19327 +         if (filename == 0)
19328 +           return ((char *)NULL);
19329 +         filename[0] = '\0';
19330 +       }
19331 +      dirname = (text && *text) ? strdup (text) : strdup (".");
19332 +      if (dirname == 0)
19333 +        return ((char *)NULL);
19335 +      temp = strrchr (dirname, '/');
19336 +      if (temp)
19337 +       {
19338 +         strcpy (filename, ++temp);
19339 +         *temp = '\0';
19340 +       }
19341 +      else
19342 +       {
19343 +         dirname[0] = '.';
19344 +         dirname[1] = '\0';
19345 +       }
19347 +      STRDUP (ud, dirname);
19348 +      udlen = strlen (ud);
19350 +      rlfe_directory_completion_hook (&dirname);
19352 +      directory = opendir (dirname);
19353 +      flen = strlen (filename);
19355 +      rl_filename_completion_desired = 1;
19356 +    }
19358 +  dentry = 0;
19359 +  while (directory && (dentry = readdir (directory)))
19360 +    {
19361 +      if (flen == 0)
19362 +       {
19363 +          if (DOT_OR_DOTDOT(dentry->d_name) == 0)
19364 +            break;
19365 +       }
19366 +      else
19367 +       {
19368 +         if ((dentry->d_name[0] == filename[0]) &&
19369 +             (strlen (dentry->d_name) >= flen) &&
19370 +             (strncmp (filename, dentry->d_name, flen) == 0))
19371 +           break;
19372 +       }
19373 +    }
19375 +  if (dentry == 0)
19376 +    {
19377 +      if (directory)
19378 +       {
19379 +         closedir (directory);
19380 +         directory = 0;
19381 +       }
19382 +      FREE (dirname);
19383 +      FREE (filename);
19384 +      FREE (ud);
19385 +      dirname = filename = ud = 0;
19386 +      return ((char *)NULL);
19387 +    }
19389 +  if (ud == 0 || (ud[0] == '.' && ud[1] == '\0'))
19390 +    temp = strdup (dentry->d_name);
19391 +  else
19392 +    {
19393 +      temp = malloc (1 + udlen + strlen (dentry->d_name));
19394 +      strcpy (temp, ud);
19395 +      strcpy (temp + udlen, dentry->d_name);
19396 +    }
19397 +  return (temp);
19399 Index: readline/shlib/Makefile.in
19400 ===================================================================
19401 RCS file: /prjz/.cvsroot/gdb/readline/shlib/Makefile.in,v
19402 retrieving revision 1.1.1.1
19403 diff -u -3 -p -r1.1.1.1 Makefile.in
19404 --- readline/shlib/Makefile.in  2003/02/16 21:36:34     1.1.1.1
19405 +++ readline/shlib/Makefile.in  2000/11/27 17:03:27
19406 @@ -36,6 +36,7 @@ ARFLAGS = @ARFLAGS@
19407  RM = rm -f
19408  CP = cp
19409  MV = mv
19410 +LN = ln
19412  SHELL = @MAKE_SHELL@
19414 @@ -43,6 +44,7 @@ host_os = @host_os@
19416  prefix = @prefix@
19417  exec_prefix = @exec_prefix@
19418 +includedir = @includedir@
19419  libdir = @libdir@
19421  CFLAGS = @CFLAGS@
19422 @@ -108,7 +110,8 @@ CSOURCES = $(topdir)/readline.c $(topdir
19423            $(topdir)/callback.c $(topdir)/terminal.c $(topdir)/xmalloc.c \
19424            $(topdir)/history.c $(topdir)/histsearch.c $(topdir)/histexpand.c \
19425            $(topdir)/histfile.c $(topdir)/nls.c $(topdir)/search.c \
19426 -          $(topdir)/shell.c $(topdir)/savestring.c $(topdir)/tilde.c
19427 +          $(topdir)/shell.c $(topdir)/savestring.c $(topdir)/compat.c \
19428 +          $(topdir)/tilde.c
19430  # The header files for this library.
19431  HSOURCES = readline.h rldefs.h chardefs.h keymaps.h history.h histlib.h \
19432 @@ -120,7 +123,7 @@ SHARED_TILDEOBJ = tilde.so
19433  SHARED_OBJ = readline.so vi_mode.so funmap.so keymaps.so parens.so search.so \
19434           rltty.so complete.so bind.so isearch.so display.so signals.so \
19435           util.so kill.so undo.so macro.so input.so callback.so terminal.so \
19436 -         nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ)
19437 +         nls.so xmalloc.so $(SHARED_HISTOBJ) $(SHARED_TILDEOBJ) compat.so
19439  ##########################################################################
19441 @@ -173,90 +176,108 @@ force:
19442  bind.so: $(topdir)/ansi_stdlib.h $(topdir)/posixstat.h
19443  bind.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19444  bind.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19445 +bind.so: $(topdir)/rltypedefs.h
19446  bind.so: $(topdir)/tilde.h $(topdir)/history.h
19447 +compat.so: $(topdir)/rlstdc.h
19448  callback.so: $(topdir)/rlconf.h
19449  callback.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h
19450  callback.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19451 +callback.so: $(topdir)/rltypedefs.h
19452  callback.so: $(topdir)/tilde.h
19453  complete.so: $(topdir)/ansi_stdlib.h posixdir.h $(topdir)/posixstat.h
19454  complete.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19455  complete.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19456 +complete.so: $(topdir)/rltypedefs.h
19457  complete.so: $(topdir)/tilde.h
19458  display.so: $(topdir)/ansi_stdlib.h $(topdir)/posixstat.h
19459  display.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19460  display.so: $(topdir)/tcap.h
19461  display.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19462 +display.so: $(topdir)/rltypedefs.h
19463  display.so: $(topdir)/tilde.h $(topdir)/history.h
19464  funmap.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19465 +funmap.so: $(topdir)/rltypedefs.h
19466  funmap.so: $(topdir)/rlconf.h $(topdir)/ansi_stdlib.h
19467  funmap.so: ${BUILD_DIR}/config.h $(topdir)/tilde.h
19468  histexpand.so: $(topdir)/ansi_stdlib.h
19469 -histexpand.so: $(topdir)/history.h histlib.h
19470 +histexpand.so: $(topdir)/history.h $(topdir)/histlib.h $(topdir)/rltypedefs.h
19471  histexpand.so: ${BUILD_DIR}/config.h
19472  histfile.so: $(topdir)/ansi_stdlib.h
19473 -histfile.so: $(topdir)/history.h histlib.h
19474 +histfile.so: $(topdir)/history.h $(topdir)/histlib.h $(topdir)/rltypedefs.h
19475  histfile.so: ${BUILD_DIR}/config.h
19476  history.so: $(topdir)/ansi_stdlib.h
19477 -history.so: $(topdir)/history.h histlib.h
19478 +history.so: $(topdir)/history.h $(topdir)/histlib.h $(topdir)/rltypedefs.h
19479  history.so: ${BUILD_DIR}/config.h
19480  histsearch.so: $(topdir)/ansi_stdlib.h
19481 -histsearch.so: $(topdir)/history.h histlib.h
19482 +histsearch.so: $(topdir)/history.h $(topdir)/histlib.h $(topdir)/rltypedefs.h
19483  histsearch.so: ${BUILD_DIR}/config.h
19484  input.so: $(topdir)/ansi_stdlib.h
19485  input.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19486  input.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19487 +input.so: $(topdir)/rltypedefs.h
19488  input.so: $(topdir)/tilde.h
19489  isearch.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19490  isearch.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19491 +isearch.so: $(topdir)/rltypedefs.h
19492  isearch.so: $(topdir)/ansi_stdlib.h $(topdir)/history.h $(topdir)/tilde.h
19493  keymaps.so: emacs_keymap.c vi_keymap.c
19494  keymaps.so: $(topdir)/keymaps.h $(topdir)/chardefs.h $(topdir)/rlconf.h
19495  keymaps.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19496 +keymaps.so: $(topdir)/rltypedefs.h
19497  keymaps.so: ${BUILD_DIR}/config.h $(topdir)/ansi_stdlib.h $(topdir)/tilde.h
19498  kill.so: $(topdir)/ansi_stdlib.h
19499  kill.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19500  kill.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19501 -kill.so: $(topdir)/tilde.h $(topdir)/history.h
19502 +kill.so: $(topdir)/tilde.h $(topdir)/history.h  $(topdir)/rltypedefs.h
19503  macro.so: $(topdir)/ansi_stdlib.h
19504  macro.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19505  macro.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19506 -macro.so: $(topdir)/tilde.h $(topdir)/history.h
19507 +macro.so: $(topdir)/tilde.h $(topdir)/history.h $(topdir)/rltypedefs.h
19508  nls.so: $(topdir)/ansi_stdlib.h
19509  nls.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19510  nls.o: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19511 +nls.o: $(topdir)/rltypedefs.h
19512  nls.o: $(topdir)/tilde.h $(topdir)/history.h $(topdir)/rlstdc.h  
19513  parens.so: $(topdir)/rlconf.h ${BUILD_DIR}/config.h
19514  parens.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19515 +parens.so: $(topdir)/rltypedefs.h
19516  parens.so: $(topdir)/tilde.h
19517  readline.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19518  readline.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19519 +readline.so: $(topdir)/rltypedefs.h
19520  readline.so: $(topdir)/history.h $(topdir)/tilde.h
19521  readline.so: $(topdir)/posixstat.h $(topdir)/ansi_stdlib.h $(topdir)/posixjmp.h
19522  rltty.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19523  rltty.so: $(topdir)/rltty.h $(topdir)/tilde.h
19524  rltty.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19525 +rltty.so: $(topdir)/rltypedefs.h
19526  search.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19527  search.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19528  search.so: $(topdir)/ansi_stdlib.h $(topdir)/history.h $(topdir)/tilde.h
19529 +search.so: $(topdir)/rltypedefs.h
19530  signals.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19531  signals.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19532  signals.so: $(topdir)/history.h $(topdir)/tilde.h
19533 +signals.so: $(topdir)/rltypedefs.h
19534  terminal.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19535  terminal.so: $(topdir)/tcap.h
19536  terminal.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19537  terminal.so: $(topdir)/tilde.h $(topdir)/history.h
19538 +terminal.so: $(topdir)/rltypedefs.h
19539  tilde.so: $(topdir)/ansi_stdlib.h ${BUILD_DIR}/config.h $(topdir)/tilde.h
19540  undo.so: $(topdir)/ansi_stdlib.h
19541  undo.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19542  undo.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19543 +undo.so: $(topdir)/rltypedefs.h
19544  undo.so: $(topdir)/tilde.h $(topdir)/history.h
19545  util.so: $(topdir)/posixjmp.h $(topdir)/ansi_stdlib.h
19546  util.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19547  util.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19548 -util.so: $(topdir)/tilde.h
19549 +util.so: $(topdir)/rltypedefs.h $(topdir)/tilde.h
19550  vi_mode.so: $(topdir)/rldefs.h ${BUILD_DIR}/config.h $(topdir)/rlconf.h
19551  vi_mode.so: $(topdir)/readline.h $(topdir)/keymaps.h $(topdir)/chardefs.h
19552  vi_mode.so: $(topdir)/history.h $(topdir)/ansi_stdlib.h $(topdir)/tilde.h
19553 +vi_mode.so: $(topdir)/rltypedefs.h
19554  xmalloc.so: ${BUILD_DIR}/config.h
19555  xmalloc.so: $(topdir)/ansi_stdlib.h
19557 @@ -315,6 +336,7 @@ keymaps.so: $(topdir)/keymaps.c
19558  parens.so: $(topdir)/parens.c
19559  search.so: $(topdir)/search.c
19560  rltty.so: $(topdir)/rltty.c
19561 +compat.so: $(topdir)/compat.c
19562  complete.so: $(topdir)/complete.c
19563  bind.so: $(topdir)/bind.c
19564  isearch.so: $(topdir)/isearch.c
19565 @@ -344,6 +366,7 @@ keymaps.so: keymaps.c
19566  parens.so: parens.c
19567  search.so: search.c
19568  rltty.so: rltty.c
19569 +comapt.so: compat.c
19570  complete.so: complete.c
19571  bind.so: bind.c
19572  isearch.so: isearch.c
19573 Index: readline/support/config.guess
19574 ===================================================================
19575 RCS file: /prjz/.cvsroot/gdb/readline/support/config.guess,v
19576 retrieving revision 1.1.1.1
19577 diff -u -3 -p -r1.1.1.1 config.guess
19578 --- readline/support/config.guess       2003/02/16 21:36:34     1.1.1.1
19579 +++ readline/support/config.guess       2000/12/18 15:43:18
19580 @@ -1,10 +1,7 @@
19581  #! /bin/sh
19582  # Attempt to guess a canonical system name.
19583 -#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
19584 -#   2000, 2001, 2002 Free Software Foundation, Inc.
19586 -timestamp='2002-02-19'
19588 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
19590  # This file is free software; you can redistribute it and/or modify it
19591  # under the terms of the GNU General Public License as published by
19592  # the Free Software Foundation; either version 2 of the License, or
19593 @@ -24,281 +21,256 @@ timestamp='2002-02-19'
19594  # configuration script generated by Autoconf, you may include it under
19595  # the same distribution terms that you use for the rest of that program.
19597 -# Originally written by Per Bothner <per@bothner.com>.
19598 -# Please send patches to <config-patches@gnu.org>.  Submit a context
19599 -# diff and a properly formatted ChangeLog entry.
19600 +# Written by Per Bothner <bothner@cygnus.com>.
19601 +# The master version of this file is at the FSF in /home/gd/gnu/lib.
19603  # This script attempts to guess a canonical system name similar to
19604  # config.sub.  If it succeeds, it prints the system name on stdout, and
19605  # exits with 0.  Otherwise, it exits with 1.
19607  # The plan is that this can be called by configure scripts if you
19608 -# don't specify an explicit build system type.
19610 -me=`echo "$0" | sed -e 's,.*/,,'`
19612 -usage="\
19613 -Usage: $0 [OPTION]
19615 -Output the configuration name of the system \`$me' is run on.
19616 +# don't specify an explicit system type (host/target name).
19618 +# Only a few systems have been added to this list; please add others
19619 +# (but try to keep the structure clean).
19622 -Operation modes:
19623 -  -h, --help         print this help, then exit
19624 -  -t, --time-stamp   print date of last modification, then exit
19625 -  -v, --version      print version number, then exit
19627 -Report bugs and patches to <config-patches@gnu.org>."
19629 -version="\
19630 -GNU config.guess ($timestamp)
19632 -Originally written by Per Bothner.
19633 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
19634 -Free Software Foundation, Inc.
19636 -This is free software; see the source for copying conditions.  There is NO
19637 -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
19639 -help="
19640 -Try \`$me --help' for more information."
19642 -# Parse command line
19643 -while test $# -gt 0 ; do
19644 -  case $1 in
19645 -    --time-stamp | --time* | -t )
19646 -       echo "$timestamp" ; exit 0 ;;
19647 -    --version | -v )
19648 -       echo "$version" ; exit 0 ;;
19649 -    --help | --h* | -h )
19650 -       echo "$usage"; exit 0 ;;
19651 -    -- )     # Stop option processing
19652 -       shift; break ;;
19653 -    - )        # Use stdin as input.
19654 -       break ;;
19655 -    -* )
19656 -       echo "$me: invalid option $1$help" >&2
19657 -       exit 1 ;;
19658 -    * )
19659 -       break ;;
19660 -  esac
19661 -done
19663 -if test $# != 0; then
19664 -  echo "$me: too many arguments$help" >&2
19665 -  exit 1
19666 +# Use $HOST_CC if defined. $CC may point to a cross-compiler
19667 +if test x"$CC_FOR_BUILD" = x; then
19668 +  if test x"$HOST_CC" != x; then
19669 +    CC_FOR_BUILD="$HOST_CC"
19670 +  else
19671 +    if test x"$CC" != x; then
19672 +      CC_FOR_BUILD="$CC"
19673 +    else
19674 +      CC_FOR_BUILD=cc
19675 +    fi
19676 +  fi
19677  fi
19680 -dummy=dummy-$$
19681 -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
19683 -# CC_FOR_BUILD -- compiler used by this script.
19684 -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
19685 -# use `HOST_CC' if defined, but it is deprecated.
19687 -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
19688 - ,,)    echo "int dummy(){}" > $dummy.c ;
19689 -       for c in cc gcc c89 ; do
19690 -         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
19691 -         if test $? = 0 ; then
19692 -            CC_FOR_BUILD="$c"; break ;
19693 -         fi ;
19694 -       done ;
19695 -       rm -f $dummy.c $dummy.o $dummy.rel ;
19696 -       if test x"$CC_FOR_BUILD" = x ; then
19697 -         CC_FOR_BUILD=no_compiler_found ;
19698 -       fi
19699 -       ;;
19700 - ,,*)   CC_FOR_BUILD=$CC ;;
19701 - ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
19702 -esac'
19704  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
19705 -# (ghazi@noc.rutgers.edu 1994-08-24)
19706 +# (ghazi@noc.rutgers.edu 8/24/94.)
19707  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
19708         PATH=$PATH:/.attbin ; export PATH
19709 +elif (test -f /usr/5bin/uname) >/dev/null 2>&1 ; then
19710 +       PATH=$PATH:/usr/5bin
19711  fi
19713 +UNAME=`(uname) 2>/dev/null` || UNAME=unknown
19714  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
19715  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
19716 -UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
19717 +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
19718  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
19720 +RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
19721 +case "$RELEASE" in
19722 +"")    RELEASE=0 ;;
19723 +*)     RELEASE=`expr "$RELEASE" + 0` ;;
19724 +esac
19725 +REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'`    # 1
19726 +REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
19728 +dummy=dummy-$$
19729 +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
19731 +# Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
19732 +# is contrary to all other versions of uname
19733 +if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV ]; then
19734 +       UNAME=UNIX_SV
19737  # Note: order is significant - the case branches are not exclusive.
19739  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
19740 -    *:NetBSD:*:*)
19741 -       # NetBSD (nbsd) targets should (where applicable) match one or
19742 -       # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
19743 -       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
19744 -       # switched to ELF, *-*-netbsd* would select the old
19745 -       # object file format.  This provides both forward
19746 -       # compatibility and a consistent mechanism for selecting the
19747 -       # object file format.
19748 -       #
19749 -       # Note: NetBSD doesn't particularly care about the vendor
19750 -       # portion of the name.  We always set it to "unknown".
19751 -       UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
19752 -           UNAME_MACHINE_ARCH=unknown
19753 -       case "${UNAME_MACHINE_ARCH}" in
19754 -           arm*) machine=arm-unknown ;;
19755 -           sh3el) machine=shl-unknown ;;
19756 -           sh3eb) machine=sh-unknown ;;
19757 -           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
19758 -       esac
19759 -       # The Operating System including object format, if it has switched
19760 -       # to ELF recently, or will in the future.
19761 -       case "${UNAME_MACHINE_ARCH}" in
19762 -           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
19763 -               eval $set_cc_for_build
19764 -               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
19765 -                       | grep __ELF__ >/dev/null
19766 -               then
19767 -                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
19768 -                   # Return netbsd for either.  FIX?
19769 -                   os=netbsd
19770 -               else
19771 -                   os=netbsdelf
19772 -               fi
19773 -               ;;
19774 -           *)
19775 -               os=netbsd
19776 -               ;;
19777 -       esac
19778 -       # The OS release
19779 -       release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19780 -       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
19781 -       # contains redundant information, the shorter form:
19782 -       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
19783 -       echo "${machine}-${os}${release}"
19784 +    # Begin cases added for Bash
19785 +    alpha:NetBSD:*:*)
19786 +       echo alpha-dec-netbsd${UNAME_RELEASE}
19787         exit 0 ;;
19788 -    amiga:OpenBSD:*:*)
19789 -       echo m68k-unknown-openbsd${UNAME_RELEASE}
19790 +    alpha:OpenBSD:*:*)
19791 +       echo alpha-dec-openbsd${UNAME_RELEASE}
19792         exit 0 ;;
19793 -    arc:OpenBSD:*:*)
19794 -       echo mipsel-unknown-openbsd${UNAME_RELEASE}
19795 +    i?86:NetBSD:*:*)
19796 +       echo ${UNAME_MACHINE}-pc-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19797         exit 0 ;;
19798 -    hp300:OpenBSD:*:*)
19799 -       echo m68k-unknown-openbsd${UNAME_RELEASE}
19800 +    i?86:OpenBSD:*:*)
19801 +       echo ${UNAME_MACHINE}-pc-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19802         exit 0 ;;
19803 -    mac68k:OpenBSD:*:*)
19804 -       echo m68k-unknown-openbsd${UNAME_RELEASE}
19805 +    sparc:NetBSD:*:*)
19806 +       echo sparc-unknown-netbsd${UNAME_RELEASE}
19807         exit 0 ;;
19808 -    macppc:OpenBSD:*:*)
19809 -       echo powerpc-unknown-openbsd${UNAME_RELEASE}
19810 +    sparc:OpenBSD:*:*)
19811 +       echo sparc-unknown-openbsd${UNAME_RELEASE}
19812         exit 0 ;;
19813 -    mvme68k:OpenBSD:*:*)
19814 -       echo m68k-unknown-openbsd${UNAME_RELEASE}
19815 +    vax:NetBSD:*:*)
19816 +       echo vax-dec-netbsd${UNAME_RELEASE}
19817         exit 0 ;;
19818 -    mvme88k:OpenBSD:*:*)
19819 -       echo m88k-unknown-openbsd${UNAME_RELEASE}
19820 +    vax:OpenBSD:*:*)
19821 +       echo vax-dec-openbsd${UNAME_RELEASE}
19822         exit 0 ;;
19823 -    mvmeppc:OpenBSD:*:*)
19824 -       echo powerpc-unknown-openbsd${UNAME_RELEASE}
19825 +    mac68k:machten:*:*)
19826 +       echo mac68k-apple-machten${UNAME_RELEASE}
19827         exit 0 ;;
19828 -    pmax:OpenBSD:*:*)
19829 -       echo mipsel-unknown-openbsd${UNAME_RELEASE}
19830 +    concurrent*:*:*:*)
19831 +       if test "`(/bin/universe) 2>/dev/null`" = att ; then
19832 +               echo concurrent-concurrent-sysv3
19833 +       else
19834 +               echo concurrent-concurrent-bsd
19835 +       fi
19836         exit 0 ;;
19837 -    sgi:OpenBSD:*:*)
19838 -       echo mipseb-unknown-openbsd${UNAME_RELEASE}
19839 +    ppc*:SunOS:5.*:*)
19840 +       echo ppc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
19841         exit 0 ;;
19842 -    sun3:OpenBSD:*:*)
19843 -       echo m68k-unknown-openbsd${UNAME_RELEASE}
19844 +    sparc:UNIX_SV:4.*:*)
19845 +       echo sparc-unknown-sysv${UNAME_RELEASE}
19846         exit 0 ;;
19847 -    wgrisc:OpenBSD:*:*)
19848 -       echo mipsel-unknown-openbsd${UNAME_RELEASE}
19849 +    mips:UNIX_SV:4.*:*)
19850 +       echo mips-mips-sysv${UNAME_RELEASE}
19851         exit 0 ;;
19852 -    *:OpenBSD:*:*)
19853 -       echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
19854 +    mips:OSF*1:*:*)
19855 +       echo mips-mips-osf1
19856 +       exit 0 ;;
19857 +    mips:4.4BSD:*:*)
19858 +       echo mips-mips-bsd4.4
19859 +       exit 0 ;;
19860 +    MIServer-S:SMP_DC.OSx:*:dcosx)
19861 +       echo mips-pyramid-sysv4
19862 +       exit 0 ;;
19863 +    news*:NEWS*:*:*)
19864 +       echo mips-sony-newsos${UNAME_RELEASE}
19865 +       exit 0 ;;
19866 +    i?86:NEXTSTEP:*:*)
19867 +       echo i386-next-nextstep${RELEASE}
19868 +       exit 0 ;;
19869 +    *680?0:NEXTSTEP:*:*)
19870 +       echo m68k-next-nextstep${RELEASE}
19871 +       exit 0 ;;    
19872 +    *370:AIX:*:*)
19873 +       echo ibm370-ibm-aix
19874 +       exit 0 ;;
19875 +    ksr1:OSF*1:*:*)
19876 +       echo ksr1-ksr-osf1
19877 +       exit 0 ;;
19878 +    esa:OSF*1:*:* | ESA:OSF*:*:*)
19879 +       echo esa-ibm-osf1
19880 +       exit 0 ;;
19881 +    DNP*:DNIX:*:*)
19882 +       echo m68k-dnix-sysv
19883 +       exit 0 ;;
19884 +    *3b2*:*:*:*)
19885 +       echo we32k-att-sysv3
19886 +       exit 0 ;;
19887 +    *:QNX:*:42*)
19888 +       echo i386-qssl-qnx`echo ${UNAME_VERSION}`
19889 +       exit 0 ;;
19890 +    Alpha*:Windows:NT:*:SP*)
19891 +       echo alpha-pc-opennt
19892 +       exit 0 ;;
19893 +    *:Windows:NT:*:SP*)
19894 +       echo intel-pc-opennt
19895 +       exit 0 ;;
19896 +    *:NonStop-UX:*:*)
19897 +       echo mips-compaq-nonstopux
19898         exit 0 ;;
19899 +    # end cases added for Bash
19900      alpha:OSF1:*:*)
19901 -       if test $UNAME_RELEASE = "V4.0"; then
19902 +       # TEST CHANGED FOR BASH to handle `letter version' releases
19903 +       UNAME_MAJOR=`echo "$UNAME_RELEASE" | sed -e 's/^.\([0-9]\).*/\1/'`
19904 +       if test X"$UNAME_MAJOR" != X"" && test $UNAME_MAJOR = 4 ; then
19905                 UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
19906 +       elif test X"$UNAME_MAJOR" != X"" && test $UNAME_MAJOR -gt 4 ; then
19907 +               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`           
19908         fi
19909         # A Vn.n version is a released version.
19910         # A Tn.n version is a released field test version.
19911         # A Xn.n version is an unreleased experimental baselevel.
19912         # 1.2 uses "1.2" for uname -r.
19913         cat <<EOF >$dummy.s
19914 -       .data
19915 -\$Lformat:
19916 -       .byte 37,100,45,37,120,10,0     # "%d-%x\n"
19918 -       .text
19919         .globl main
19920 -       .align 4
19921         .ent main
19922  main:
19923 -       .frame \$30,16,\$26,0
19924 -       ldgp \$29,0(\$27)
19925 -       .prologue 1
19926 -       .long 0x47e03d80 # implver \$0
19927 -       lda \$2,-1
19928 -       .long 0x47e20c21 # amask \$2,\$1
19929 -       lda \$16,\$Lformat
19930 -       mov \$0,\$17
19931 -       not \$1,\$18
19932 -       jsr \$26,printf
19933 -       ldgp \$29,0(\$26)
19934 -       mov 0,\$16
19935 -       jsr \$26,exit
19936 +       .frame \$30,0,\$26,0
19937 +       .prologue 0
19938 +       .long 0x47e03d80 # implver $0
19939 +       lda \$2,259
19940 +       .long 0x47e20c21 # amask $2,$1
19941 +       srl \$1,8,\$2
19942 +       sll \$2,2,\$2
19943 +       sll \$0,3,\$0
19944 +       addl \$1,\$0,\$0
19945 +       addl \$2,\$0,\$0
19946 +       ret \$31,(\$26),1
19947         .end main
19948  EOF
19949 -       eval $set_cc_for_build
19950         $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
19951         if test "$?" = 0 ; then
19952 -               case `./$dummy` in
19953 -                       0-0)
19954 +               ./$dummy
19955 +               case "$?" in
19956 +                       7)
19957                                 UNAME_MACHINE="alpha"
19958                                 ;;
19959 -                       1-0)
19960 +                       15)
19961                                 UNAME_MACHINE="alphaev5"
19962                                 ;;
19963 -                       1-1)
19964 +                       14)
19965                                 UNAME_MACHINE="alphaev56"
19966                                 ;;
19967 -                       1-101)
19968 +                       10)
19969                                 UNAME_MACHINE="alphapca56"
19970                                 ;;
19971 -                       2-303)
19972 +                       16)
19973                                 UNAME_MACHINE="alphaev6"
19974                                 ;;
19975 -                       2-307)
19976 -                               UNAME_MACHINE="alphaev67"
19977 -                               ;;
19978 -                       2-1307)
19979 -                               UNAME_MACHINE="alphaev68"
19980 -                               ;;
19981                 esac
19982         fi
19983         rm -f $dummy.s $dummy
19984         echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
19985         exit 0 ;;
19986      Alpha\ *:Windows_NT*:*)
19987 -       # How do we know it's Interix rather than the generic POSIX subsystem?
19988 -       # Should we change UNAME_MACHINE based on the output of uname instead
19989 -       # of the specific Alpha model?
19990 -       echo alpha-pc-interix
19991 -       exit 0 ;;
19992 +        # How do we know it's Interix rather than the generic POSIX subsystem?
19993 +        # Should we change UNAME_MACHINE based on the output of uname instead
19994 +        # of the specific Alpha model?
19995 +        echo alpha-pc-interix
19996 +        exit 0 ;;
19997      21064:Windows_NT:50:3)
19998         echo alpha-dec-winnt3.5
19999         exit 0 ;;
20000      Amiga*:UNIX_System_V:4.0:*)
20001 -       echo m68k-unknown-sysv4
20002 +       echo m68k-cbm-sysv4
20003         exit 0;;
20004 +    amiga:NetBSD:*:*)
20005 +       echo m68k-cbm-netbsd${UNAME_RELEASE}
20006 +       exit 0 ;;
20007 +    amiga:OpenBSD:*:*)
20008 +       echo m68k-cbm-openbsd${UNAME_RELEASE}
20009 +       exit 0 ;;
20010      *:[Aa]miga[Oo][Ss]:*:*)
20011         echo ${UNAME_MACHINE}-unknown-amigaos
20012         exit 0 ;;
20013 -    *:[Mm]orph[Oo][Ss]:*:*)
20014 -       echo ${UNAME_MACHINE}-unknown-morphos
20015 +    arc64:OpenBSD:*:*)
20016 +       echo mips64el-unknown-openbsd${UNAME_RELEASE}
20017         exit 0 ;;
20018 -    *:OS/390:*:*)
20019 -       echo i370-ibm-openedition
20020 +    arc:OpenBSD:*:*)
20021 +       echo mipsel-unknown-openbsd${UNAME_RELEASE}
20022 +       exit 0 ;;
20023 +    hkmips:OpenBSD:*:*)
20024 +       echo mips-unknown-openbsd${UNAME_RELEASE}
20025 +       exit 0 ;;
20026 +    pmax:OpenBSD:*:*)
20027 +       echo mipsel-unknown-openbsd${UNAME_RELEASE}
20028 +       exit 0 ;;
20029 +    sgi:OpenBSD:*:*)
20030 +       echo mips-unknown-openbsd${UNAME_RELEASE}
20031         exit 0 ;;
20032 +    wgrisc:OpenBSD:*:*)
20033 +       echo mipsel-unknown-openbsd${UNAME_RELEASE}
20034 +       exit 0 ;;
20035      arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
20036         echo arm-acorn-riscix${UNAME_RELEASE}
20037         exit 0;;
20038 -    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
20039 +    arm32:NetBSD:*:*)
20040 +       echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
20041 +       exit 0 ;;
20042 +    SR2?01:HI-UX/MPP:*:*)
20043         echo hppa1.1-hitachi-hiuxmpp
20044         exit 0;;
20045      Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
20046 @@ -309,12 +281,12 @@ EOF
20047                 echo pyramid-pyramid-bsd
20048         fi
20049         exit 0 ;;
20050 -    NILE*:*:*:dcosx)
20051 +    NILE:*:*:*:dcosx)
20052         echo pyramid-pyramid-svr4
20053         exit 0 ;;
20054      sun4H:SunOS:5.*:*)
20055 -       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
20056 -       exit 0 ;;
20057 +        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
20058 +        exit 0 ;;
20059      sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
20060         echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
20061         exit 0 ;;
20062 @@ -340,7 +312,7 @@ EOF
20063         echo m68k-sun-sunos${UNAME_RELEASE}
20064         exit 0 ;;
20065      sun*:*:4.2BSD:*)
20066 -       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
20067 +       UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
20068         test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
20069         case "`/bin/arch`" in
20070             sun3)
20071 @@ -354,23 +326,29 @@ EOF
20072      aushp:SunOS:*:*)
20073         echo sparc-auspex-sunos${UNAME_RELEASE}
20074         exit 0 ;;
20075 +    atari*:NetBSD:*:*)
20076 +       echo m68k-atari-netbsd${UNAME_RELEASE}
20077 +       exit 0 ;;
20078 +    atari*:OpenBSD:*:*)
20079 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
20080 +       exit 0 ;;
20081      # The situation for MiNT is a little confusing.  The machine name
20082      # can be virtually everything (everything which is not
20083 -    # "atarist" or "atariste" at least should have a processor
20084 +    # "atarist" or "atariste" at least should have a processor 
20085      # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
20086      # to the lowercase version "mint" (or "freemint").  Finally
20087      # the system name "TOS" denotes a system which is actually not
20088      # MiNT.  But MiNT is downward compatible to TOS, so this should
20089      # be no problem.
20090      atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
20091 -        echo m68k-atari-mint${UNAME_RELEASE}
20092 -       exit 0 ;;
20093 +       echo m68k-atari-mint${UNAME_RELEASE}
20094 +       exit 0 ;;
20095      atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
20096 -       echo m68k-atari-mint${UNAME_RELEASE}
20097 -        exit 0 ;;
20098 +       echo m68k-atari-mint${UNAME_RELEASE}
20099 +       exit 0 ;;
20100      *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
20101 -        echo m68k-atari-mint${UNAME_RELEASE}
20102 -       exit 0 ;;
20103 +       echo m68k-atari-mint${UNAME_RELEASE}
20104 +       exit 0 ;;
20105      milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
20106          echo m68k-milan-mint${UNAME_RELEASE}
20107          exit 0 ;;
20108 @@ -380,9 +358,33 @@ EOF
20109      *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
20110          echo m68k-unknown-mint${UNAME_RELEASE}
20111          exit 0 ;;
20112 +    sun3*:NetBSD:*:*)
20113 +       echo m68k-sun-netbsd${UNAME_RELEASE}
20114 +       exit 0 ;;
20115 +    sun3*:OpenBSD:*:*)
20116 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
20117 +       exit 0 ;;
20118 +    mac68k:NetBSD:*:*)
20119 +       echo m68k-apple-netbsd${UNAME_RELEASE}
20120 +       exit 0 ;;
20121 +    mac68k:OpenBSD:*:*)
20122 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
20123 +       exit 0 ;;
20124 +    mvme68k:OpenBSD:*:*)
20125 +       echo m68k-unknown-openbsd${UNAME_RELEASE}
20126 +       exit 0 ;;
20127 +    mvme88k:OpenBSD:*:*)
20128 +       echo m88k-unknown-openbsd${UNAME_RELEASE}
20129 +       exit 0 ;;
20130 +    *:"Mac OS":*:*)
20131 +       echo `uname -p`-apple-macos${UNAME_RELEASE}
20132 +       exit 0 ;;
20133      powerpc:machten:*:*)
20134         echo powerpc-apple-machten${UNAME_RELEASE}
20135         exit 0 ;;
20136 +    macppc:NetBSD:*:*)
20137 +        echo powerpc-apple-netbsd${UNAME_RELEASE}
20138 +        exit 0 ;;
20139      RISC*:Mach:*:*)
20140         echo mips-dec-mach_bsd4.3
20141         exit 0 ;;
20142 @@ -396,10 +398,8 @@ EOF
20143         echo clipper-intergraph-clix${UNAME_RELEASE}
20144         exit 0 ;;
20145      mips:*:*:UMIPS | mips:*:*:RISCos)
20146 -       eval $set_cc_for_build
20147         sed 's/^        //' << EOF >$dummy.c
20148  #ifdef __cplusplus
20149 -#include <stdio.h>  /* for printf() prototype */
20150         int main (int argc, char *argv[]) {
20151  #else
20152         int main (argc, argv) int argc; char *argv[]; {
20153 @@ -420,13 +420,10 @@ EOF
20154  EOF
20155         $CC_FOR_BUILD $dummy.c -o $dummy \
20156           && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
20157 -         && rm -f $dummy.c $dummy && exit 0
20158 +         && rm $dummy.c $dummy && exit 0
20159         rm -f $dummy.c $dummy
20160         echo mips-mips-riscos${UNAME_RELEASE}
20161         exit 0 ;;
20162 -    Motorola:PowerMAX_OS:*:*)
20163 -       echo powerpc-motorola-powermax
20164 -       exit 0 ;;
20165      Night_Hawk:Power_UNIX:*:*)
20166         echo powerpc-harris-powerunix
20167         exit 0 ;;
20168 @@ -440,19 +437,17 @@ EOF
20169         echo m88k-motorola-sysv3
20170         exit 0 ;;
20171      AViiON:dgux:*:*)
20172 -        # DG/UX returns AViiON for all architectures
20173 -        UNAME_PROCESSOR=`/usr/bin/uname -p`
20174 -       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
20175 -       then
20176 -           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
20177 -              [ ${TARGET_BINARY_INTERFACE}x = x ]
20178 -           then
20179 +       # DG/UX returns AViiON for all architectures
20180 +       UNAME_PROCESSOR=`/usr/bin/uname -p`
20181 +       if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
20182 +         if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
20183 +            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
20184                 echo m88k-dg-dgux${UNAME_RELEASE}
20185 -           else
20186 +         else
20187                 echo m88k-dg-dguxbcs${UNAME_RELEASE}
20188 -           fi
20189 +         fi
20190         else
20191 -           echo i586-dg-dgux${UNAME_RELEASE}
20192 +         echo i586-dg-dgux${UNAME_RELEASE}
20193         fi
20194         exit 0 ;;
20195      M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
20196 @@ -474,20 +469,11 @@ EOF
20197      ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
20198         echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
20199         exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
20200 -    i*86:AIX:*:*)
20201 +    i?86:AIX:*:*)
20202         echo i386-ibm-aix
20203         exit 0 ;;
20204 -    ia64:AIX:*:*)
20205 -       if [ -x /usr/bin/oslevel ] ; then
20206 -               IBM_REV=`/usr/bin/oslevel`
20207 -       else
20208 -               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
20209 -       fi
20210 -       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
20211 -       exit 0 ;;
20212      *:AIX:2:3)
20213         if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
20214 -               eval $set_cc_for_build
20215                 sed 's/^                //' << EOF >$dummy.c
20216                 #include <sys/systemcfg.h>
20218 @@ -499,7 +485,7 @@ EOF
20219                         exit(0);
20220                         }
20221  EOF
20222 -               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
20223 +               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
20224                 rm -f $dummy.c $dummy
20225                 echo rs6000-ibm-aix3.2.5
20226         elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
20227 @@ -508,17 +494,21 @@ EOF
20228                 echo rs6000-ibm-aix3.2
20229         fi
20230         exit 0 ;;
20231 -    *:AIX:*:[45])
20232 -       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
20233 -       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
20234 +    *:AIX:*:4)
20235 +       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
20236 +       if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
20237                 IBM_ARCH=rs6000
20238         else
20239                 IBM_ARCH=powerpc
20240         fi
20241         if [ -x /usr/bin/oslevel ] ; then
20242                 IBM_REV=`/usr/bin/oslevel`
20243 +       elif grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
20244 +               IBM_REV=4.1
20245 +       elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
20246 +               IBM_REV=4.1.1
20247         else
20248 -               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
20249 +               IBM_REV=4.${UNAME_RELEASE}
20250         fi
20251         echo ${IBM_ARCH}-ibm-aix${IBM_REV}
20252         exit 0 ;;
20253 @@ -528,7 +518,7 @@ EOF
20254      ibmrt:4.4BSD:*|romp-ibm:BSD:*)
20255         echo romp-ibm-bsd4.4
20256         exit 0 ;;
20257 -    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
20258 +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
20259         echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
20260         exit 0 ;;                           # report: romp-ibm BSD 4.3
20261      *:BOSX:*:*)
20262 @@ -544,30 +534,11 @@ EOF
20263         echo m68k-hp-bsd4.4
20264         exit 0 ;;
20265      9000/[34678]??:HP-UX:*:*)
20266 -       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
20267         case "${UNAME_MACHINE}" in
20268 -           9000/31? )            HP_ARCH=m68000 ;;
20269 -           9000/[34]?? )         HP_ARCH=m68k ;;
20270 +           9000/31? )          HP_ARCH=m68000 ;;
20271 +           9000/[34]?? )       HP_ARCH=m68k ;;
20272             9000/[678][0-9][0-9])
20273 -               if [ -x /usr/bin/getconf ]; then
20274 -                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
20275 -                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
20276 -                    case "${sc_cpu_version}" in
20277 -                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
20278 -                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
20279 -                      532)                      # CPU_PA_RISC2_0
20280 -                        case "${sc_kernel_bits}" in
20281 -                          32) HP_ARCH="hppa2.0n" ;;
20282 -                          64) HP_ARCH="hppa2.0w" ;;
20283 -                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
20284 -                        esac ;;
20285 -                    esac
20286 -               fi
20287 -               if [ "${HP_ARCH}" = "" ]; then
20288 -                   eval $set_cc_for_build
20289 -                   sed 's/^              //' << EOF >$dummy.c
20291 -              #define _HPUX_SOURCE
20292 +              sed 's/^              //' << EOF >$dummy.c
20293                #include <stdlib.h>
20294                #include <unistd.h>
20296 @@ -598,19 +569,13 @@ EOF
20297                    exit (0);
20298                }
20299  EOF
20300 -                   (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
20301 -                   if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
20302 -                   rm -f $dummy.c $dummy
20303 -               fi ;;
20304 +       ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
20305 +       rm -f $dummy.c $dummy
20306         esac
20307 -       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
20308 -       exit 0 ;;
20309 -    ia64:HP-UX:*:*)
20310         HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
20311 -       echo ia64-hp-hpux${HPUX_REV}
20312 +       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
20313         exit 0 ;;
20314      3050*:HI-UX:*:*)
20315 -       eval $set_cc_for_build
20316         sed 's/^        //' << EOF >$dummy.c
20317         #include <unistd.h>
20318         int
20319 @@ -636,7 +601,7 @@ EOF
20320           exit (0);
20321         }
20322  EOF
20323 -       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
20324 +       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
20325         rm -f $dummy.c $dummy
20326         echo unknown-hitachi-hiuxwe2
20327         exit 0 ;;
20328 @@ -645,17 +610,17 @@ EOF
20329         exit 0 ;;
20330      9000/8??:4.3bsd:*:*)
20331         echo hppa1.0-hp-bsd
20332 -       exit 0 ;;
20333 -    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
20334 -       echo hppa1.0-hp-mpeix
20335         exit 0 ;;
20336 +    *9??*:MPE/iX:*:*)
20337 +        echo hppa1.0-hp-mpeix
20338 +        exit 0 ;;
20339      hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
20340         echo hppa1.1-hp-osf
20341         exit 0 ;;
20342      hp8??:OSF1:*:*)
20343         echo hppa1.0-hp-osf
20344         exit 0 ;;
20345 -    i*86:OSF1:*:*)
20346 +    i?86:OSF1:*:*)
20347         if [ -x /usr/sbin/sysversion ] ; then
20348             echo ${UNAME_MACHINE}-unknown-osf1mk
20349         else
20350 @@ -665,6 +630,9 @@ EOF
20351      parisc*:Lites*:*:*)
20352         echo hppa1.1-hp-lites
20353         exit 0 ;;
20354 +    hppa*:OpenBSD:*:*)
20355 +        echo hppa-unknown-openbsd
20356 +        exit 0 ;;
20357      C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
20358         echo c1-convex-bsd
20359          exit 0 ;;
20360 @@ -683,44 +651,63 @@ EOF
20361      C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
20362         echo c4-convex-bsd
20363          exit 0 ;;
20364 +    CRAY*X-MP:*:*:*)
20365 +       echo xmp-cray-unicos
20366 +        exit 0 ;;
20367      CRAY*Y-MP:*:*:*)
20368 -       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
20369 +       echo ymp-cray-unicos${UNAME_RELEASE}
20370         exit 0 ;;
20371      CRAY*[A-Z]90:*:*:*)
20372         echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
20373         | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
20374 -             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
20375 -             -e 's/\.[^.]*$/.X/'
20376 +             -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
20377         exit 0 ;;
20378      CRAY*TS:*:*:*)
20379 -       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
20380 +       echo t90-cray-unicos${UNAME_RELEASE}
20381         exit 0 ;;
20382 -    CRAY*T3D:*:*:*)
20383 -       echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
20384 -       exit 0 ;;
20385      CRAY*T3E:*:*:*)
20386 -       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
20387 +        echo alpha-cray-unicosmk${UNAME_RELEASE}
20388 +        exit 0 ;;
20389 +    CRAY-2:*:*:*)
20390 +       echo cray2-cray-unicos
20391 +        exit 0 ;;
20392 +    F300:UNIX_System_V:*:*)
20393 +       FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
20394 +       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
20395 +       echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
20396 +       exit 0 ;;
20397 +    F301:UNIX_System_V:*:*)
20398 +       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
20399         exit 0 ;;
20400 -    CRAY*SV1:*:*:*)
20401 -       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
20402 +    hp3[0-9][05]:NetBSD:*:*)
20403 +       echo m68k-hp-netbsd${UNAME_RELEASE}
20404         exit 0 ;;
20405 -    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
20406 -       FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
20407 -        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
20408 -        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
20409 -        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
20410 +    hp300:OpenBSD:*:*)
20411 +        echo m68k-unknown-openbsd${UNAME_RELEASE}
20412          exit 0 ;;
20413 -    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
20414 +    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
20415         echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
20416         exit 0 ;;
20417      sparc*:BSD/OS:*:*)
20418 -       echo sparc-unknown-bsdi${UNAME_RELEASE}
20419 -       exit 0 ;;
20420 +        echo sparc-unknown-bsdi${UNAME_RELEASE}
20421 +        exit 0 ;;
20422      *:BSD/OS:*:*)
20423 -       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
20424 -       exit 0 ;;
20425 +        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
20426 +        exit 0 ;;
20427      *:FreeBSD:*:*)
20428 -       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
20429 +       if test -x /usr/bin/objformat; then
20430 +           if test "elf" = "`/usr/bin/objformat`"; then
20431 +               echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
20432 +               exit 0
20433 +           fi
20434 +       fi
20435 +       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=(].*//'`
20436 +       exit 0 ;;
20437 +    *:NetBSD:*:*)
20438 +       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
20439 +       exit 0 ;;
20440 +    *:OpenBSD:*:*)
20441 +       echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
20442         exit 0 ;;
20443      i*:CYGWIN*:*)
20444         echo ${UNAME_MACHINE}-pc-cygwin
20445 @@ -728,190 +715,225 @@ EOF
20446      i*:MINGW*:*)
20447         echo ${UNAME_MACHINE}-pc-mingw32
20448         exit 0 ;;
20449 -    i*:PW*:*)
20450 -       echo ${UNAME_MACHINE}-pc-pw32
20451 -       exit 0 ;;
20452 -    x86:Interix*:3*)
20453 -       echo i386-pc-interix3
20454 -       exit 0 ;;
20455      i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
20456 -       # How do we know it's Interix rather than the generic POSIX subsystem?
20457 -       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
20458 -       # UNAME_MACHINE based on the output of uname instead of i386?
20459 -       echo i386-pc-interix
20460 -       exit 0 ;;
20461 +        # How do we know it's Interix rather than the generic POSIX subsystem?
20462 +        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
20463 +        # UNAME_MACHINE based on the output of uname instead of i386?
20464 +        echo i386-pc-interix
20465 +        exit 0 ;;
20466      i*:UWIN*:*)
20467 -       echo ${UNAME_MACHINE}-pc-uwin
20468 -       exit 0 ;;
20469 +        echo ${UNAME_MACHINE}-pc-uwin
20470 +        exit 0 ;;
20471      p*:CYGWIN*:*)
20472         echo powerpcle-unknown-cygwin
20473 -       exit 0 ;;
20474 +       exit 0 ;;    
20475      prep*:SunOS:5.*:*)
20476         echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
20477         exit 0 ;;
20478      *:GNU:*:*)
20479         echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
20480         exit 0 ;;
20481 -    i*86:Minix:*:*)
20482 -       echo ${UNAME_MACHINE}-pc-minix
20483 -       exit 0 ;;
20484 -    arm*:Linux:*:*)
20485 -       echo ${UNAME_MACHINE}-unknown-linux-gnu
20486 -       exit 0 ;;
20487 -    ia64:Linux:*:*)
20488 -       echo ${UNAME_MACHINE}-unknown-linux
20489 -       exit 0 ;;
20490 -    m68*:Linux:*:*)
20491 -       echo ${UNAME_MACHINE}-unknown-linux-gnu
20492 -       exit 0 ;;
20493 -    mips:Linux:*:*)
20494 -       eval $set_cc_for_build
20495 -       sed 's/^        //' << EOF >$dummy.c
20496 -       #undef CPU
20497 -       #undef mips
20498 -       #undef mipsel
20499 -       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 
20500 -       CPU=mipsel 
20501 -       #else
20502 -       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 
20503 -       CPU=mips
20504 -       #else
20505 -       CPU=
20506 -       #endif
20507 -       #endif 
20508 -EOF
20509 -       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
20510 -       rm -f $dummy.c
20511 -       test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
20512 -       ;;
20513 -    ppc:Linux:*:*)
20514 -       echo powerpc-unknown-linux-gnu
20515 -       exit 0 ;;
20516 -    ppc64:Linux:*:*)
20517 -       echo powerpc64-unknown-linux-gnu
20518 -       exit 0 ;;
20519 -    alpha:Linux:*:*)
20520 -       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
20521 -         EV5)   UNAME_MACHINE=alphaev5 ;;
20522 -         EV56)  UNAME_MACHINE=alphaev56 ;;
20523 -         PCA56) UNAME_MACHINE=alphapca56 ;;
20524 -         PCA57) UNAME_MACHINE=alphapca56 ;;
20525 -         EV6)   UNAME_MACHINE=alphaev6 ;;
20526 -         EV67)  UNAME_MACHINE=alphaev67 ;;
20527 -         EV68*) UNAME_MACHINE=alphaev68 ;;
20528 +    *:Linux:*:*)
20529 +        # uname on the ARM produces all sorts of strangeness, and we need to
20530 +        # filter it out.
20531 +        case "$UNAME_MACHINE" in
20532 +          armv*)                      UNAME_MACHINE=$UNAME_MACHINE ;;
20533 +          arm* | sa110*)              UNAME_MACHINE="arm" ;;
20534          esac
20535 -       objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
20536 -       if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
20537 -       echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
20538 -       exit 0 ;;
20539 -    parisc:Linux:*:* | hppa:Linux:*:*)
20540 -       # Look for CPU level
20541 -       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
20542 -         PA7*) echo hppa1.1-unknown-linux-gnu ;;
20543 -         PA8*) echo hppa2.0-unknown-linux-gnu ;;
20544 -         *)    echo hppa-unknown-linux-gnu ;;
20545 -       esac
20546 -       exit 0 ;;
20547 -    parisc64:Linux:*:* | hppa64:Linux:*:*)
20548 -       echo hppa64-unknown-linux-gnu
20549 -       exit 0 ;;
20550 -    s390:Linux:*:* | s390x:Linux:*:*)
20551 -       echo ${UNAME_MACHINE}-ibm-linux
20552 -       exit 0 ;;
20553 -    sh*:Linux:*:*)
20554 -       echo ${UNAME_MACHINE}-unknown-linux-gnu
20555 -       exit 0 ;;
20556 -    sparc:Linux:*:* | sparc64:Linux:*:*)
20557 -       echo ${UNAME_MACHINE}-unknown-linux-gnu
20558 -       exit 0 ;;
20559 -    x86_64:Linux:*:*)
20560 -       echo x86_64-unknown-linux-gnu
20561 -       exit 0 ;;
20562 -    i*86:Linux:*:*)
20564         # The BFD linker knows what the default object file format is, so
20565 -       # first see if it will tell us. cd to the root directory to prevent
20566 +       # first see if it will tell us.  cd to the root directory to prevent
20567         # problems with other programs or directories called `ld' in the path.
20568 -       # Set LC_ALL=C to ensure ld outputs messages in English.
20569 -       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
20570 -                        | sed -ne '/supported targets:/!d
20571 +       ld_help_string=`cd /; ld --help 2>&1`
20572 +       ld_supported_emulations=`echo $ld_help_string \
20573 +                        | sed -ne '/supported emulations:/!d
20574                                     s/[         ][      ]*/ /g
20575 -                                   s/.*supported targets: *//
20576 +                                   s/.*supported emulations: *//
20577                                     s/ .*//
20578                                     p'`
20579 -        case "$ld_supported_targets" in
20580 -         elf32-i386)
20581 -               TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
20582 -               ;;
20583 -         a.out-i386-linux)
20584 -               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
20585 -               exit 0 ;;               
20586 -         coff-i386)
20587 -               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
20588 -               exit 0 ;;
20589 -         "")
20590 -               # Either a pre-BFD a.out linker (linux-gnuoldld) or
20591 -               # one that does not give us useful --help.
20592 -               echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
20593 -               exit 0 ;;
20594 -       esac
20595 -       # Determine whether the default compiler is a.out or elf
20596 -       eval $set_cc_for_build
20597 -       sed 's/^        //' << EOF >$dummy.c
20598 -       #include <features.h>
20599 -       #ifdef __ELF__
20600 -       # ifdef __GLIBC__
20601 -       #  if __GLIBC__ >= 2
20602 -       LIBC=gnu
20603 -       #  else
20604 -       LIBC=gnulibc1
20605 -       #  endif
20606 -       # else
20607 -       LIBC=gnulibc1
20608 -       # endif
20609 -       #else
20610 -       #ifdef __INTEL_COMPILER
20611 -       LIBC=gnu
20612 -       #else
20613 -       LIBC=gnuaout
20614 -       #endif
20615 -       #endif
20616 +       case "$ld_supported_emulations" in
20617 +         *ia64)      echo "${UNAME_MACHINE}-unknown-linux"         ; exit 0 ;;
20618 +         i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
20619 +         i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
20620 +         sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
20621 +         armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
20622 +         m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
20623 +         elf32ppc | elf32ppclinux)
20624 +               # Determine Lib Version
20625 +               cat >$dummy.c <<EOF
20626 +#include <features.h>
20627 +#if defined(__GLIBC__)
20628 +extern char __libc_version[];
20629 +extern char __libc_release[];
20630 +#endif
20631 +main(argc, argv)
20632 +     int argc;
20633 +     char *argv[];
20635 +#if defined(__GLIBC__)
20636 +  printf("%s %s\n", __libc_version, __libc_release);
20637 +#else
20638 +  printf("unkown\n");
20639 +#endif
20640 +  return 0;
20642 +EOF
20643 +               LIBC=""
20644 +               $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
20645 +               if test "$?" = 0 ; then
20646 +                       ./$dummy | grep 1\.99 > /dev/null
20647 +                       if test "$?" = 0 ; then
20648 +                               LIBC="libc1"
20649 +                       fi
20650 +               fi      
20651 +               rm -f $dummy.c $dummy
20652 +               echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
20653 +       esac
20655 +       if test "${UNAME_MACHINE}" = "alpha" ; then
20656 +               sed 's/^        //'  <<EOF >$dummy.s
20657 +               .globl main
20658 +               .ent main
20659 +       main:
20660 +               .frame \$30,0,\$26,0
20661 +               .prologue 0
20662 +               .long 0x47e03d80 # implver $0
20663 +               lda \$2,259
20664 +               .long 0x47e20c21 # amask $2,$1
20665 +               srl \$1,8,\$2
20666 +               sll \$2,2,\$2
20667 +               sll \$0,3,\$0
20668 +               addl \$1,\$0,\$0
20669 +               addl \$2,\$0,\$0
20670 +               ret \$31,(\$26),1
20671 +               .end main
20672 +EOF
20673 +               LIBC=""
20674 +               $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
20675 +               if test "$?" = 0 ; then
20676 +                       ./$dummy
20677 +                       case "$?" in
20678 +                       7)
20679 +                               UNAME_MACHINE="alpha"
20680 +                               ;;
20681 +                       15)
20682 +                               UNAME_MACHINE="alphaev5"
20683 +                               ;;
20684 +                       14)
20685 +                               UNAME_MACHINE="alphaev56"
20686 +                               ;;
20687 +                       10)
20688 +                               UNAME_MACHINE="alphapca56"
20689 +                               ;;
20690 +                       16)
20691 +                               UNAME_MACHINE="alphaev6"
20692 +                               ;;
20693 +                       esac
20695 +                       objdump --private-headers $dummy | \
20696 +                         grep ld.so.1 > /dev/null
20697 +                       if test "$?" = 0 ; then
20698 +                               LIBC="libc1"
20699 +                       fi
20700 +               fi
20701 +               rm -f $dummy.s $dummy
20702 +               echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
20703 +       elif test "${UNAME_MACHINE}" = "mips" ; then
20704 +         cat >$dummy.c <<EOF
20705 +#ifdef __cplusplus
20706 +int main (int argc, char *argv[]) {
20707 +#else
20708 +int main (argc, argv) int argc; char *argv[]; {
20709 +#endif
20710 +#ifdef __MIPSEB__
20711 +  printf ("%s-unknown-linux-gnu\n", argv[1]);
20712 +#endif
20713 +#ifdef __MIPSEL__
20714 +  printf ("%sel-unknown-linux-gnu\n", argv[1]);
20715 +#endif
20716 +  return 0;
20718 +EOF
20719 +         $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
20720 +         rm -f $dummy.c $dummy
20721 +       else
20722 +         # Either a pre-BFD a.out linker (linux-gnuoldld)
20723 +         # or one that does not give us useful --help.
20724 +         # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
20725 +         # If ld does not provide *any* "supported emulations:"
20726 +         # that means it is gnuoldld.
20727 +         echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
20728 +         test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
20730 +         case "${UNAME_MACHINE}" in
20731 +         i?86)
20732 +           VENDOR=pc;
20733 +           ;;
20734 +         *)
20735 +           VENDOR=unknown;
20736 +           ;;
20737 +         esac
20738 +         # Determine whether the default compiler is a.out or elf
20739 +         cat >$dummy.c <<EOF
20740 +#include <features.h>
20741 +#ifdef __cplusplus
20742 +       int main (int argc, char *argv[]) {
20743 +#else
20744 +       int main (argc, argv) int argc; char *argv[]; {
20745 +#endif
20746 +#ifdef __ELF__
20747 +# ifdef __GLIBC__
20748 +#  if __GLIBC__ >= 2
20749 +    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
20750 +#  else
20751 +    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
20752 +#  endif
20753 +# else
20754 +   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
20755 +# endif
20756 +#else
20757 +  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
20758 +#endif
20759 +  return 0;
20761  EOF
20762 -       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
20763 -       rm -f $dummy.c
20764 -       test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
20765 -       test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
20766 -       ;;
20767 -    i*86:DYNIX/ptx:4*:*)
20768 -       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
20769 -       # earlier versions are messed up and put the nodename in both
20770 -       # sysname and nodename.
20771 +         ${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
20772 +         rm -f $dummy.c $dummy
20773 +       fi ;;
20774 +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
20775 +# are messed up and put the nodename in both sysname and nodename.
20776 +    i?86:DYNIX/ptx:4*:*)
20777         echo i386-sequent-sysv4
20778         exit 0 ;;
20779 -    i*86:UNIX_SV:4.2MP:2.*)
20780 -        # Unixware is an offshoot of SVR4, but it has its own version
20781 -        # number series starting with 2...
20782 -        # I am not positive that other SVR4 systems won't match this,
20783 +# added by chet for bash based on usenet posting from <hops@sco.com> and
20784 +# documentation on SCO's web site -- UnixWare 7 (SVR5)
20785 +#    i?86:UnixWare:5*:*)
20786 +#      echo ${UNAME_MACHINE}-pc-sysv5uw${UNAME_VERSION}
20787 +#      exit 0 ;;
20788 +    i?86:UNIX_SV:4.2MP:2.*)
20789 +       # Unixware is an offshoot of SVR4, but it has its own version
20790 +       # number series starting with 2...
20791 +       # I am not positive that other SVR4 systems won't match this,
20792         # I just have to hope.  -- rms.
20793 -        # Use sysv4.2uw... so that sysv4* matches it.
20794 +       # Use sysv4.2uw... so that sysv4* matches it.
20795         echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
20796         exit 0 ;;
20797 -    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
20798 -       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
20799 +    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:* | i?86:UNIX_SV:4.*:*)
20800         if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
20801 -               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
20802 +               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
20803         else
20804 -               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
20805 +               echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
20806         fi
20807 -       exit 0 ;;
20808 -    i*86:*:5:[78]*)
20809 -       case `/bin/uname -X | grep "^Machine"` in
20810 -           *486*)           UNAME_MACHINE=i486 ;;
20811 -           *Pentium)        UNAME_MACHINE=i586 ;;
20812 -           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
20813 -       esac
20814 -       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
20815         exit 0 ;;
20816 -    i*86:*:3.2:*)
20817 +    i?86:*:5:7*)
20818 +        UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
20819 +        (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
20820 +        (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
20821 +        (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
20822 +        (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
20823 +        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
20824 +        exit 0 ;;
20825 +    i?86:*:3.2:*)
20826         if test -f /usr/options/cb.name; then
20827                 UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
20828                 echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
20829 @@ -929,15 +951,11 @@ EOF
20830                 echo ${UNAME_MACHINE}-pc-sysv32
20831         fi
20832         exit 0 ;;
20833 -    i*86:*DOS:*:*)
20834 -       echo ${UNAME_MACHINE}-pc-msdosdjgpp
20835 -       exit 0 ;;
20836      pc:*:*:*)
20837 -       # Left here for compatibility:
20838 -        # uname -m prints for DJGPP always 'pc', but it prints nothing about
20839 -        # the processor, so we play safe by assuming i386.
20840 +       # uname -m prints for DJGPP always 'pc', but it prints nothing about
20841 +       # the processor, so we play safe by assuming i386.
20842         echo i386-pc-msdosdjgpp
20843 -        exit 0 ;;
20844 +       exit 0 ;;
20845      Intel:Mach:3*:*)
20846         echo i386-pc-mach3
20847         exit 0 ;;
20848 @@ -957,7 +975,7 @@ EOF
20849         exit 0 ;;
20850      M68*:*:R3V[567]*:*)
20851         test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
20852 -    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
20853 +    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
20854         OS_REL=''
20855         test -r /etc/.relid \
20856         && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
20857 @@ -966,35 +984,32 @@ EOF
20858         /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
20859           && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
20860      3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
20861 -        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
20862 -          && echo i486-ncr-sysv4 && exit 0 ;;
20863 -    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
20864 -       echo m68k-unknown-lynxos${UNAME_RELEASE}
20865 -       exit 0 ;;
20866 +       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
20867 +         && echo i486-ncr-sysv4 && exit 0 ;;
20868      mc68030:UNIX_System_V:4.*:*)
20869         echo m68k-atari-sysv4
20870         exit 0 ;;
20871 -    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
20872 -       echo i386-unknown-lynxos${UNAME_RELEASE}
20873 +    m68*:LynxOS:2.*:*)
20874 +       echo m68k-unknown-lynxos${UNAME_RELEASE}
20875 +       exit 0 ;;
20876 +    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
20877 +       echo i386-pc-lynxos${UNAME_RELEASE}
20878         exit 0 ;;
20879      TSUNAMI:LynxOS:2.*:*)
20880         echo sparc-unknown-lynxos${UNAME_RELEASE}
20881         exit 0 ;;
20882 -    rs6000:LynxOS:2.*:*)
20883 +    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
20884         echo rs6000-unknown-lynxos${UNAME_RELEASE}
20885         exit 0 ;;
20886 -    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
20887 -       echo powerpc-unknown-lynxos${UNAME_RELEASE}
20888 +    *:LynxOS:*:*)
20889 +       echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
20890         exit 0 ;;
20891      SM[BE]S:UNIX_SV:*:*)
20892         echo mips-dde-sysv${UNAME_RELEASE}
20893         exit 0 ;;
20894 -    RM*:ReliantUNIX-*:*:*)
20895 +    RM*:SINIX-*:*:* | RM*:ReliantUNIX-*:*:*)
20896         echo mips-sni-sysv4
20897         exit 0 ;;
20898 -    RM*:SINIX-*:*:*)
20899 -       echo mips-sni-sysv4
20900 -       exit 0 ;;
20901      *:SINIX-*:*:*)
20902         if uname -p 2>/dev/null >/dev/null ; then
20903                 UNAME_MACHINE=`(uname -p) 2>/dev/null`
20904 @@ -1003,10 +1018,10 @@ EOF
20905                 echo ns32k-sni-sysv
20906         fi
20907         exit 0 ;;
20908 -    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
20909 -                      # says <Richard.M.Bartel@ccMail.Census.GOV>
20910 -        echo i586-unisys-sysv4
20911 -        exit 0 ;;
20912 +    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
20913 +                          # says <Richard.M.Bartel@ccMail.Census.GOV>
20914 +       echo i586-unisys-sysv4
20915 +       exit 0 ;;
20916      *:UNIX_System_V:4*:FTX*)
20917         # From Gerald Hewes <hewes@openmarket.com>.
20918         # How about differentiating between stratus architectures? -djm
20919 @@ -1015,31 +1030,27 @@ EOF
20920      *:*:*:FTX*)
20921         # From seanf@swdc.stratus.com.
20922         echo i860-stratus-sysv4
20923 -       exit 0 ;;
20924 -    *:VOS:*:*)
20925 -       # From Paul.Green@stratus.com.
20926 -       echo hppa1.1-stratus-vos
20927 -       exit 0 ;;
20928 +       exit 0 ;;              
20929      mc68*:A/UX:*:*)
20930         echo m68k-apple-aux${UNAME_RELEASE}
20931         exit 0 ;;
20932 -    news*:NEWS-OS:6*:*)
20933 +    news*:NEWS-OS:*:6*)
20934         echo mips-sony-newsos6
20935         exit 0 ;;
20936 -    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
20937 +    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
20938         if [ -d /usr/nec ]; then
20939 -               echo mips-nec-sysv${UNAME_RELEASE}
20940 +               echo mips-nec-sysv${UNAME_RELEASE}
20941         else
20942 -               echo mips-unknown-sysv${UNAME_RELEASE}
20943 +               echo mips-unknown-sysv${UNAME_RELEASE}
20944         fi
20945 -        exit 0 ;;
20946 -    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
20947 -       echo powerpc-be-beos
20948 +       exit 0 ;;
20949 +    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
20950 +       echo powerpc-apple-beos
20951         exit 0 ;;
20952 -    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
20953 +    BeMac:BeOS:*:*)
20954         echo powerpc-apple-beos
20955         exit 0 ;;
20956 -    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
20957 +    BePC:BeOS:*:*)
20958         echo i586-pc-beos
20959         exit 0 ;;
20960      SX-4:SUPER-UX:*:*)
20961 @@ -1053,79 +1064,18 @@ EOF
20962         exit 0 ;;
20963      *:Rhapsody:*:*)
20964         echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
20965 -       exit 0 ;;
20966 -    *:Darwin:*:*)
20967 -       echo `uname -p`-apple-darwin${UNAME_RELEASE}
20968 -       exit 0 ;;
20969 -    *:procnto*:*:* | *:QNX:[0123456789]*:*)
20970 -       if test "${UNAME_MACHINE}" = "x86pc"; then
20971 -               UNAME_MACHINE=pc
20972 -               echo i386-${UNAME_MACHINE}-nto-qnx
20973 -       else
20974 -               echo `uname -p`-${UNAME_MACHINE}-nto-qnx
20975 -       fi
20976 -       exit 0 ;;
20977 -    *:QNX:*:4*)
20978 -       echo i386-pc-qnx
20979 -       exit 0 ;;
20980 -    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
20981 -       echo nsr-tandem-nsk${UNAME_RELEASE}
20982 -       exit 0 ;;
20983 -    *:NonStop-UX:*:*)
20984 -       echo mips-compaq-nonstopux
20985 -       exit 0 ;;
20986 -    BS2000:POSIX*:*:*)
20987 -       echo bs2000-siemens-sysv
20988 -       exit 0 ;;
20989 -    DS/*:UNIX_System_V:*:*)
20990 -       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
20991 -       exit 0 ;;
20992 -    *:Plan9:*:*)
20993 -       # "uname -m" is not consistent, so use $cputype instead. 386
20994 -       # is converted to i386 for consistency with other x86
20995 -       # operating systems.
20996 -       if test "$cputype" = "386"; then
20997 -           UNAME_MACHINE=i386
20998 -       else
20999 -           UNAME_MACHINE="$cputype"
21000 -       fi
21001 -       echo ${UNAME_MACHINE}-unknown-plan9
21002 -       exit 0 ;;
21003 -    i*86:OS/2:*:*)
21004 -       # If we were able to find `uname', then EMX Unix compatibility
21005 -       # is probably installed.
21006 -       echo ${UNAME_MACHINE}-pc-os2-emx
21007 -       exit 0 ;;
21008 -    *:TOPS-10:*:*)
21009 -       echo pdp10-unknown-tops10
21010 -       exit 0 ;;
21011 -    *:TENEX:*:*)
21012 -       echo pdp10-unknown-tenex
21013 -       exit 0 ;;
21014 -    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
21015 -       echo pdp10-dec-tops20
21016         exit 0 ;;
21017 -    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
21018 -       echo pdp10-xkl-tops20
21019 +    Power*:Darwin:*:*)
21020 +       echo powerpc-apple-darwin${UNAME_RELEASE}
21021         exit 0 ;;
21022 -    *:TOPS-20:*:*)
21023 -       echo pdp10-unknown-tops20
21024 -       exit 0 ;;
21025 -    *:ITS:*:*)
21026 -       echo pdp10-unknown-its
21027 -       exit 0 ;;
21028 -    i*86:XTS-300:*:STOP)
21029 -       echo ${UNAME_MACHINE}-unknown-stop
21030 -       exit 0 ;;
21031 -    i*86:atheos:*:*)
21032 -       echo ${UNAME_MACHINE}-unknown-atheos
21033 +    *:Darwin:*:*)
21034 +       echo ${UNAME_MACHINE}-apple-darwin${UNAME_RELEASE}
21035         exit 0 ;;
21036  esac
21038  #echo '(No uname command or uname output not recognized.)' 1>&2
21039  #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
21041 -eval $set_cc_for_build
21042  cat >$dummy.c <<EOF
21043  #ifdef _SEQUENT_
21044  # include <sys/types.h>
21045 @@ -1151,7 +1101,11 @@ main ()
21046  #endif
21048  #if defined (__arm) && defined (__acorn) && defined (__unix)
21049 -  printf ("arm-acorn-riscix"); exit (0);
21050 +  printf ("arm-acorn-riscix\n"); exit (0);
21051 +#endif
21053 +#if defined (hp9000) && !defined (hpux)
21054 +  printf ("m68k-hp-bsd\n"); exit (0);
21055  #endif
21057  #if defined (hp300) && !defined (hpux)
21058 @@ -1212,35 +1166,129 @@ main ()
21059  #endif
21061  #if defined (vax)
21062 -# if !defined (ultrix)
21063 -#  include <sys/param.h>
21064 -#  if defined (BSD)
21065 -#   if BSD == 43
21066 -      printf ("vax-dec-bsd4.3\n"); exit (0);
21067 -#   else
21068 -#    if BSD == 199006
21069 -      printf ("vax-dec-bsd4.3reno\n"); exit (0);
21070 -#    else
21071 -      printf ("vax-dec-bsd\n"); exit (0);
21072 -#    endif
21073 -#   endif
21074 -#  else
21075 -    printf ("vax-dec-bsd\n"); exit (0);
21076 -#  endif
21077 -# else
21078 -    printf ("vax-dec-ultrix\n"); exit (0);
21079 -# endif
21080 +#if !defined (ultrix)
21081 +  printf ("vax-dec-bsd\n"); exit (0);
21082 +#else
21083 +  printf ("vax-dec-ultrix\n"); exit (0);
21084 +#endif
21085  #endif
21087  #if defined (alliant) && defined (i860)
21088    printf ("i860-alliant-bsd\n"); exit (0);
21089  #endif
21091 +/* Begin cases added for Bash */
21092 +#if defined (tahoe)
21093 +  printf ("tahoe-cci-bsd\n"); exit (0);
21094 +#endif
21096 +#if defined (nec_ews)
21097 +#  if defined (SYSTYPE_SYSV)
21098 +  printf ("ews4800-nec-sysv4\n"); exit 0;
21099 +#  else
21100 +  printf ("ews4800-nec-bsd\n"); exit (0);
21101 +#  endif
21102 +#endif
21104 +#if defined (sony)
21105 +#  if defined (SYSTYPE_SYSV)
21106 +  printf ("mips-sony-sysv4\n"); exit 0;
21107 +#  else
21108 +  printf ("mips-sony-bsd\n"); exit (0);
21109 +#  endif
21110 +#endif
21112 +#if defined (ardent)
21113 +  printf ("titan-ardent-bsd\n"); exit (0);
21114 +#endif
21116 +#if defined (stardent)
21117 +  printf ("stardent-stardent-sysv\n"); exit (0);
21118 +#endif
21120 +#if defined (ibm032)
21121 +  printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
21122 +#endif
21124 +#if defined (sequent) && defined (i386)
21125 +  printf ("i386-sequent-bsd\n"); exit (0);
21126 +#endif
21128 +#if defined (qnx) && defined (i386)
21129 +  printf ("i386-pc-qnx\n"); exit (0);
21130 +#endif
21132 +#if defined (gould)
21133 +  printf ("gould-gould-bsd\n"); exit (0);
21134 +#endif
21136 +#if defined (unixpc)
21137 +  printf ("unixpc-att-sysv\n"); exit (0);
21138 +#endif
21140 +#if defined (att386)
21141 +  printf ("i386-att-sysv3\n"); exit (0);
21142 +#endif
21144 +#if defined (__m88k) && defined (__UMAXV__)
21145 +  printf ("m88k-encore-sysv3\n"); exit (0);
21146 +#endif
21148 +#if defined (drs6000)
21149 +  printf ("drs6000-icl-sysv4.2\n"); exit (0);
21150 +#endif
21152 +#if defined (clipper)
21153 +  printf ("clipper-orion-bsd\n"); exit (0);
21154 +#endif
21156 +#if defined (is68k)
21157 +  printf ("m68k-isi-bsd\n"); exit (0);
21158 +#endif
21160 +#if defined (luna88k)
21161 +  printf ("luna88k-omron-bsd\n"); exit (0);
21162 +#endif
21164 +#if defined (butterfly) && defined (BFLY1)
21165 +  printf ("butterfly-bbn-mach\n"); exit (0);
21166 +#endif
21168 +#if defined (tower32)
21169 +  printf ("tower32-ncr-sysv4\n"); exit (0);
21170 +#endif
21172 +#if defined (MagicStation)
21173 +  printf ("magicstation-unknown-bsd\n"); exit (0);
21174 +#endif
21176 +#if defined (scs)
21177 +  printf ("symmetric-scs-bsd4.2\n"); exit (0);
21178 +#endif
21180 +#if defined (tandem)
21181 +  printf ("tandem-tandem-sysv\n"); exit (0);
21182 +#endif
21184 +#if defined (cadmus)
21185 +  printf ("cadmus-pcs-sysv\n"); exit (0);
21186 +#endif
21188 +#if defined (masscomp)
21189 +  printf ("masscomp-masscomp-sysv3\n"); exit (0);
21190 +#endif
21192 +#if defined (hbullx20)
21193 +  printf ("hbullx20-bull-sysv3\n"); exit (0);
21194 +#endif
21196 +/* End cases added for Bash */
21198    exit (1);
21200  EOF
21202 -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
21203 +${CC-cc} $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
21204  rm -f $dummy.c $dummy
21206  # Apollos put the system type in the environment.
21207 @@ -1273,48 +1321,21 @@ then
21208      esac
21209  fi
21211 -cat >&2 <<EOF
21212 -$0: unable to guess system type
21213 +# Begin cases added for Bash
21214 +case "$UNAME" in
21215 +uts) echo uts-amdahl-sysv${UNAME_RELEASE}; exit 0 ;;
21216 +esac
21218 -This script, last modified $timestamp, has failed to recognize
21219 -the operating system you are using. It is advised that you
21220 -download the most up to date version of the config scripts from
21222 -    ftp://ftp.gnu.org/pub/gnu/config/
21224 -If the version you run ($0) is already up to date, please
21225 -send the following data and any information you think might be
21226 -pertinent to <config-patches@gnu.org> in order to provide the needed
21227 -information to handle your system.
21229 -config.guess timestamp = $timestamp
21231 -uname -m = `(uname -m) 2>/dev/null || echo unknown`
21232 -uname -r = `(uname -r) 2>/dev/null || echo unknown`
21233 -uname -s = `(uname -s) 2>/dev/null || echo unknown`
21234 -uname -v = `(uname -v) 2>/dev/null || echo unknown`
21236 -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
21237 -/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
21239 -hostinfo               = `(hostinfo) 2>/dev/null`
21240 -/bin/universe          = `(/bin/universe) 2>/dev/null`
21241 -/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
21242 -/bin/arch              = `(/bin/arch) 2>/dev/null`
21243 -/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
21244 -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
21246 -UNAME_MACHINE = ${UNAME_MACHINE}
21247 -UNAME_RELEASE = ${UNAME_RELEASE}
21248 -UNAME_SYSTEM  = ${UNAME_SYSTEM}
21249 -UNAME_VERSION = ${UNAME_VERSION}
21250 -EOF
21251 +if [ -d /usr/amiga ]; then
21252 +       echo m68k-cbm-sysv${UNAME_RELEASE}; exit 0;
21255 -exit 1
21256 +if [ -f /bin/fxc.info ]; then
21257 +       echo fxc-alliant-concentrix
21258 +       exit 0
21260 +# end cases added for Bash
21262 -# Local variables:
21263 -# eval: (add-hook 'write-file-hooks 'time-stamp)
21264 -# time-stamp-start: "timestamp='"
21265 -# time-stamp-format: "%:y-%02m-%02d"
21266 -# time-stamp-end: "'"
21267 -# End:
21268 +#echo '(Unable to guess system type)' 1>&2
21270 +exit 1
21271 Index: readline/support/config.sub
21272 ===================================================================
21273 RCS file: /prjz/.cvsroot/gdb/readline/support/config.sub,v
21274 retrieving revision 1.1.1.1
21275 diff -u -3 -p -r1.1.1.1 config.sub
21276 --- readline/support/config.sub 2003/02/16 21:36:34     1.1.1.1
21277 +++ readline/support/config.sub 2001/02/12 17:50:05
21278 @@ -1,10 +1,6 @@
21279  #! /bin/sh
21280 -# Configuration validation subroutine script.
21281 -#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
21282 -#   2000, 2001, 2002 Free Software Foundation, Inc.
21284 -timestamp='2002-02-22'
21286 +# Configuration validation subroutine script, version 1.1.
21287 +#   Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
21288  # This file is (in principle) common to ALL GNU software.
21289  # The presence of a machine in this file suggests that SOME GNU software
21290  # can handle that machine.  It does not imply ALL GNU software can.
21291 @@ -29,9 +25,6 @@ timestamp='2002-02-22'
21292  # configuration script generated by Autoconf, you may include it under
21293  # the same distribution terms that you use for the rest of that program.
21295 -# Please send patches to <config-patches@gnu.org>.  Submit a context
21296 -# diff and a properly formatted ChangeLog entry.
21298  # Configuration subroutine to validate and canonicalize a configuration type.
21299  # Supply the specified configuration type as an argument.
21300  # If it is invalid, we print an error message on stderr and exit with code 1.
21301 @@ -52,73 +45,30 @@ timestamp='2002-02-22'
21302  #      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
21303  # It is wrong to echo any other type of specification.
21305 -me=`echo "$0" | sed -e 's,.*/,,'`
21306 +if [ x$1 = x ]
21307 +then
21308 +       echo Configuration name missing. 1>&2
21309 +       echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
21310 +       echo "or     $0 ALIAS" 1>&2
21311 +       echo where ALIAS is a recognized configuration type. 1>&2
21312 +       exit 1
21315 -usage="\
21316 -Usage: $0 [OPTION] CPU-MFR-OPSYS
21317 -       $0 [OPTION] ALIAS
21319 -Canonicalize a configuration name.
21321 -Operation modes:
21322 -  -h, --help         print this help, then exit
21323 -  -t, --time-stamp   print date of last modification, then exit
21324 -  -v, --version      print version number, then exit
21326 -Report bugs and patches to <config-patches@gnu.org>."
21328 -version="\
21329 -GNU config.sub ($timestamp)
21331 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
21332 -Free Software Foundation, Inc.
21334 -This is free software; see the source for copying conditions.  There is NO
21335 -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
21337 -help="
21338 -Try \`$me --help' for more information."
21340 -# Parse command line
21341 -while test $# -gt 0 ; do
21342 -  case $1 in
21343 -    --time-stamp | --time* | -t )
21344 -       echo "$timestamp" ; exit 0 ;;
21345 -    --version | -v )
21346 -       echo "$version" ; exit 0 ;;
21347 -    --help | --h* | -h )
21348 -       echo "$usage"; exit 0 ;;
21349 -    -- )     # Stop option processing
21350 -       shift; break ;;
21351 -    - )        # Use stdin as input.
21352 -       break ;;
21353 -    -* )
21354 -       echo "$me: invalid option $1$help"
21355 -       exit 1 ;;
21357 -    *local*)
21358 -       # First pass through any local machine types.
21359 -       echo $1
21360 -       exit 0;;
21362 -    * )
21363 -       break ;;
21364 -  esac
21365 -done
21367 -case $# in
21368 - 0) echo "$me: missing argument$help" >&2
21369 -    exit 1;;
21370 - 1) ;;
21371 - *) echo "$me: too many arguments$help" >&2
21372 -    exit 1;;
21373 +# First pass through any local machine types.
21374 +case $1 in
21375 +       *local*)
21376 +               echo $1
21377 +               exit 0
21378 +               ;;
21379 +       *)
21380 +       ;;
21381  esac
21383  # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
21384  # Here we must recognize all the valid KERNEL-OS combinations.
21385  maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
21386  case $maybe_os in
21387 -  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
21388 +  linux-gnu*)
21389      os=-$maybe_os
21390      basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
21391      ;;
21392 @@ -144,7 +94,7 @@ case $os in
21393         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
21394         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
21395         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
21396 -       -apple | -axis)
21397 +       -apple )
21398                 os=
21399                 basic_machine=$1
21400                 ;;
21401 @@ -155,17 +105,9 @@ case $os in
21402         -scout)
21403                 ;;
21404         -wrs)
21405 -               os=-vxworks
21406 -               basic_machine=$1
21407 -               ;;
21408 -       -chorusos*)
21409 -               os=-chorusos
21410 +               os=vxworks
21411                 basic_machine=$1
21412                 ;;
21413 -       -chorusrdb)
21414 -               os=-chorusrdb
21415 -               basic_machine=$1
21416 -               ;;
21417         -hiux*)
21418                 os=-hiuxwe2
21419                 ;;
21420 @@ -214,60 +156,33 @@ case $os in
21421         -psos*)
21422                 os=-psos
21423                 ;;
21424 -       -mint | -mint[0-9]*)
21425 -               basic_machine=m68k-atari
21426 -               os=-mint
21427 -               ;;
21428  esac
21430  # Decode aliases for certain CPU-COMPANY combinations.
21431  case $basic_machine in
21432         # Recognize the basic CPU types without company name.
21433         # Some are omitted here because they have special meanings below.
21434 -       1750a | 580 \
21435 -       | a29k \
21436 -       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
21437 -       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
21438 -       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
21439 -       | c4x | clipper \
21440 -       | d10v | d30v | dsp16xx \
21441 -       | fr30 \
21442 -       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
21443 -       | i370 | i860 | i960 | ia64 \
21444 -       | m32r | m68000 | m68k | m88k | mcore \
21445 -       | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
21446 -       | mips64vr4100 | mips64vr4100el | mips64vr4300 \
21447 -       | mips64vr4300el | mips64vr5000 | mips64vr5000el \
21448 -       | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
21449 -       | mipsisa32 \
21450 -       | mn10200 | mn10300 \
21451 -       | ns16k | ns32k \
21452 -       | openrisc | or32 \
21453 -       | pdp10 | pdp11 | pj | pjl \
21454 -       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
21455 -       | pyramid \
21456 -       | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
21457 -       | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
21458 -       | strongarm \
21459 -       | tahoe | thumb | tic80 | tron \
21460 -       | v850 | v850e \
21461 -       | we32k \
21462 -       | x86 | xscale | xstormy16 | xtensa \
21463 -       | z8k)
21464 -               basic_machine=$basic_machine-unknown
21465 -               ;;
21466 -       m6811 | m68hc11 | m6812 | m68hc12)
21467 -               # Motorola 68HC11/12.
21468 +       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
21469 +               | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
21470 +               | 580 | i960 | h8300 \
21471 +               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
21472 +               | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
21473 +               | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
21474 +               | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
21475 +               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
21476 +               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
21477 +               | mips64vr5000 | miprs64vr5000el | mcore \
21478 +               | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
21479 +               | thumb | d10v | s390)
21480                 basic_machine=$basic_machine-unknown
21481 -               os=-none
21482                 ;;
21483 -       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
21484 +       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65)
21485                 ;;
21487         # We use `pc' rather than `unknown'
21488         # because (1) that's what they normally are, and
21489         # (2) the word "unknown" tends to confuse beginning users.
21490 -       i*86 | x86_64)
21491 +       i[34567]86)
21492           basic_machine=$basic_machine-pc
21493           ;;
21494         # Object if more than one company name word.
21495 @@ -276,46 +191,33 @@ case $basic_machine in
21496                 exit 1
21497                 ;;
21498         # Recognize the basic CPU types with company name.
21499 -       580-* \
21500 -       | a29k-* \
21501 -       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
21502 -       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
21503 -       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
21504 -       | arm-*  | armbe-* | armle-* | armv*-* \
21505 -       | avr-* \
21506 -       | bs2000-* \
21507 -       | c[123]* | c30-* | [cjt]90-* | c54x-* \
21508 -       | clipper-* | cydra-* \
21509 -       | d10v-* | d30v-* \
21510 -       | elxsi-* \
21511 -       | f30[01]-* | f700-* | fr30-* | fx80-* \
21512 -       | h8300-* | h8500-* \
21513 -       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
21514 -       | i*86-* | i860-* | i960-* | ia64-* \
21515 -       | m32r-* \
21516 -       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
21517 -       | m88110-* | m88k-* | mcore-* \
21518 -       | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
21519 -       | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
21520 -       | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
21521 -       | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
21522 -       | none-* | np1-* | ns16k-* | ns32k-* \
21523 -       | orion-* \
21524 -       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
21525 -       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
21526 -       | pyramid-* \
21527 -       | romp-* | rs6000-* \
21528 -       | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
21529 -       | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
21530 -       | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
21531 -       | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
21532 -       | v850-* | v850e-* | vax-* \
21533 -       | we32k-* \
21534 -       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
21535 -       | xtensa-* \
21536 -       | ymp-* \
21537 -       | z8k-*)
21538 +       # FIXME: clean up the formatting here.
21539 +       vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
21540 +             | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
21541 +             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
21542 +             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
21543 +             | xmp-* | ymp-* \
21544 +             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
21545 +             | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
21546 +             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
21547 +             | clipper-* | orion-* \
21548 +             | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
21549 +             | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
21550 +             | mips64el-* | mips64orion-* | mips64orionel-* \
21551 +             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
21552 +             | mipstx39-* | mipstx39el-* | mcore-* \
21553 +             | f301-* | armv*-* | t3e-* \
21554 +             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
21555 +             | thumb-* | v850-* | d30v-* | tic30-* | c30-* )
21556 +               ;;
21557 +       # BEGIN cases added for Bash
21558 +       butterfly-bbn* | cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
21559 +             | tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
21560 +             | concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
21561 +             | *-convex | sx[45]*-nec )
21562                 ;;
21563 +       # END cases added for Bash
21565         # Recognize the various machine names and aliases which stand
21566         # for a CPU type and a company and sometimes even an OS.
21567         386bsd)
21568 @@ -351,14 +253,15 @@ case $basic_machine in
21569                 os=-sysv
21570                 ;;
21571         amiga | amiga-*)
21572 +#              basic_machine=m68k-cbm
21573                 basic_machine=m68k-unknown
21574                 ;;
21575         amigaos | amigados)
21576 -               basic_machine=m68k-unknown
21577 +               basic_machine=m68k-cbm
21578                 os=-amigaos
21579                 ;;
21580         amigaunix | amix)
21581 -               basic_machine=m68k-unknown
21582 +               basic_machine=m68k-cbm
21583                 os=-sysv4
21584                 ;;
21585         apollo68)
21586 @@ -377,10 +280,6 @@ case $basic_machine in
21587                 basic_machine=ns32k-sequent
21588                 os=-dynix
21589                 ;;
21590 -       c90)
21591 -               basic_machine=c90-cray
21592 -               os=-unicos
21593 -               ;;
21594         convex-c1)
21595                 basic_machine=c1-convex
21596                 os=-bsd
21597 @@ -401,30 +300,27 @@ case $basic_machine in
21598                 basic_machine=c38-convex
21599                 os=-bsd
21600                 ;;
21601 -       cray | j90)
21602 -               basic_machine=j90-cray
21603 +       cray | ymp)
21604 +               basic_machine=ymp-cray
21605                 os=-unicos
21606                 ;;
21607 +       cray2)
21608 +               basic_machine=cray2-cray
21609 +               os=-unicos
21610 +               ;;
21611 +       [ctj]90-cray)
21612 +               basic_machine=c90-cray
21613 +               os=-unicos
21614 +               ;;
21615         crds | unos)
21616                 basic_machine=m68k-crds
21617                 ;;
21618 -       cris | cris-* | etrax*)
21619 -               basic_machine=cris-axis
21620 -               ;;
21621         da30 | da30-*)
21622                 basic_machine=m68k-da30
21623                 ;;
21624         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
21625                 basic_machine=mips-dec
21626                 ;;
21627 -       decsystem10* | dec10*)
21628 -               basic_machine=pdp10-dec
21629 -               os=-tops10
21630 -               ;;
21631 -       decsystem20* | dec20*)
21632 -               basic_machine=pdp10-dec
21633 -               os=-tops20
21634 -               ;;
21635         delta | 3300 | motorola-3300 | motorola-delta \
21636               | 3300-motorola | delta-motorola)
21637                 basic_machine=m68k-motorola
21638 @@ -441,6 +337,9 @@ case $basic_machine in
21639                 basic_machine=m68k-bull
21640                 os=-sysv3
21641                 ;;
21642 +       hbullx20-bull)
21643 +               basic_machine=m68k-bull
21644 +               ;;
21645         ebmon29k)
21646                 basic_machine=a29k-amd
21647                 os=-ebmon
21648 @@ -449,7 +348,7 @@ case $basic_machine in
21649                 basic_machine=elxsi-elxsi
21650                 os=-bsd
21651                 ;;
21652 -       encore | umax | mmax)
21653 +       encore | umax | mmax | multimax)
21654                 basic_machine=ns32k-encore
21655                 ;;
21656         es1800 | OSE68k | ose68k | ose | OSE)
21657 @@ -466,10 +365,6 @@ case $basic_machine in
21658                 basic_machine=tron-gmicro
21659                 os=-sysv
21660                 ;;
21661 -       go32)
21662 -               basic_machine=i386-pc
21663 -               os=-go32
21664 -               ;;
21665         h3050r* | hiux*)
21666                 basic_machine=hppa1.1-hitachi
21667                 os=-hiuxwe2
21668 @@ -541,23 +436,27 @@ case $basic_machine in
21669                 basic_machine=hppa1.1-hp
21670                 os=-proelf
21671                 ;;
21672 +       ibm032-*)
21673 +               basic_machine=ibmrt-ibm
21674 +               ;;
21675         i370-ibm* | ibm*)
21676                 basic_machine=i370-ibm
21677 +               os=-mvs
21678                 ;;
21679  # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
21680 -       i*86v32)
21681 +       i[34567]86v32)
21682                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
21683                 os=-sysv32
21684                 ;;
21685 -       i*86v4*)
21686 +       i[34567]86v4*)
21687                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
21688                 os=-sysv4
21689                 ;;
21690 -       i*86v)
21691 +       i[34567]86v)
21692                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
21693                 os=-sysv
21694                 ;;
21695 -       i*86sol2)
21696 +       i[34567]86sol2)
21697                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
21698                 os=-solaris2
21699                 ;;
21700 @@ -569,6 +468,14 @@ case $basic_machine in
21701                 basic_machine=i386-unknown
21702                 os=-vsta
21703                 ;;
21704 +       i386-go32 | go32)
21705 +               basic_machine=i386-unknown
21706 +               os=-go32
21707 +               ;;
21708 +       i386-mingw32 | mingw32)
21709 +               basic_machine=i386-unknown
21710 +               os=-mingw32
21711 +               ;;
21712         iris | iris4d)
21713                 basic_machine=mips-sgi
21714                 case $os in
21715 @@ -583,9 +490,12 @@ case $basic_machine in
21716                 basic_machine=m68k-isi
21717                 os=-sysv
21718                 ;;
21719 -       m88k-omron*)
21720 +       luna88k-omron* | m88k-omron*)
21721                 basic_machine=m88k-omron
21722                 ;;
21723 +       magicstation*)
21724 +               basic_machine=magicstation-unknown
21725 +               ;;
21726         magnum | m3230)
21727                 basic_machine=mips-mips
21728                 os=-sysv
21729 @@ -594,43 +504,35 @@ case $basic_machine in
21730                 basic_machine=ns32k-utek
21731                 os=-sysv
21732                 ;;
21733 -       mingw32)
21734 -               basic_machine=i386-pc
21735 -               os=-mingw32
21736 -               ;;
21737         miniframe)
21738                 basic_machine=m68000-convergent
21739                 ;;
21740 -       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
21741 +       *mint | *MiNT)
21742                 basic_machine=m68k-atari
21743                 os=-mint
21744                 ;;
21745 +       mipsel*-linux*)
21746 +               basic_machine=mipsel-unknown
21747 +               os=-linux-gnu
21748 +               ;;
21749 +       mips*-linux*)
21750 +               basic_machine=mips-unknown
21751 +               os=-linux-gnu
21752 +               ;;
21753         mips3*-*)
21754                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
21755                 ;;
21756         mips3*)
21757                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
21758                 ;;
21759 -       mmix*)
21760 -               basic_machine=mmix-knuth
21761 -               os=-mmixware
21762 -               ;;
21763         monitor)
21764                 basic_machine=m68k-rom68k
21765                 os=-coff
21766                 ;;
21767 -       morphos)
21768 -               basic_machine=powerpc-unknown
21769 -               os=-morphos
21770 -               ;;
21771         msdos)
21772 -               basic_machine=i386-pc
21773 +               basic_machine=i386-unknown
21774                 os=-msdos
21775                 ;;
21776 -       mvs)
21777 -               basic_machine=i370-ibm
21778 -               os=-mvs
21779 -               ;;
21780         ncr3000)
21781                 basic_machine=i486-ncr
21782                 os=-sysv4
21783 @@ -640,7 +542,7 @@ case $basic_machine in
21784                 os=-netbsd
21785                 ;;
21786         netwinder)
21787 -               basic_machine=armv4l-rebel
21788 +               basic_machine=armv4l-corel
21789                 os=-linux
21790                 ;;
21791         news | news700 | news800 | news900)
21792 @@ -654,11 +556,11 @@ case $basic_machine in
21793         news-3600 | risc-news)
21794                 basic_machine=mips-sony
21795                 os=-newsos
21796 -               ;;
21797 -       necv70)
21798 -               basic_machine=v70-nec
21799 -               os=-sysv
21800                 ;;
21801 +        necv70)
21802 +                basic_machine=v70-nec
21803 +                os=-sysv
21804 +                ;;
21805         next | m*-next )
21806                 basic_machine=m68k-next
21807                 case $os in
21808 @@ -684,36 +586,33 @@ case $basic_machine in
21809                 basic_machine=i960-intel
21810                 os=-nindy
21811                 ;;
21812 -       mon960)
21813 -               basic_machine=i960-intel
21814 -               os=-mon960
21815 -               ;;
21816 -       nonstopux)
21817 -               basic_machine=mips-compaq
21818 -               os=-nonstopux
21819 -               ;;
21820 +        mon960)
21821 +                basic_machine=i960-intel
21822 +                os=-mon960
21823 +                ;;
21824         np1)
21825                 basic_machine=np1-gould
21826 -               ;;
21827 -       nsr-tandem)
21828 -               basic_machine=nsr-tandem
21829 -               ;;
21830 -       op50n-* | op60c-*)
21831 -               basic_machine=hppa1.1-oki
21832 -               os=-proelf
21833                 ;;
21834 -       or32 | or32-*)
21835 -               basic_machine=or32-unknown
21836 -               os=-coff
21837 -               ;;
21838 -       OSE68000 | ose68000)
21839 -               basic_machine=m68000-ericsson
21840 -               os=-ose
21841 +       osr5 | sco5)    # SCO Open Server
21842 +               basic_machine=i386-pc
21843 +               os=-sco3.2v5
21844                 ;;
21845 -       os68k)
21846 -               basic_machine=m68k-none
21847 -               os=-os68k
21848 +       odt | odt3 | odt4)      # SCO Open Desktop
21849 +               basic_machine=i386-pc
21850 +               os=-sco3.2v4
21851                 ;;
21852 +        op50n-* | op60c-*)
21853 +                basic_machine=hppa1.1-oki
21854 +                os=-proelf
21855 +                ;;
21856 +        OSE68000 | ose68000)
21857 +                basic_machine=m68000-ericsson
21858 +                os=-ose
21859 +                ;;
21860 +        os68k)
21861 +                basic_machine=m68k-none
21862 +                os=-os68k
21863 +                ;;
21864         pa-hitachi)
21865                 basic_machine=hppa1.1-hitachi
21866                 os=-hiuxwe2
21867 @@ -728,79 +627,63 @@ case $basic_machine in
21868         pbb)
21869                 basic_machine=m68k-tti
21870                 ;;
21871 -        pc532 | pc532-*)
21872 +       pc532 | pc532-*)
21873                 basic_machine=ns32k-pc532
21874 -               ;;
21875 -       pentium | p5 | k5 | k6 | nexgen | viac3)
21876 -               basic_machine=i586-pc
21877                 ;;
21878 -       pentiumpro | p6 | 6x86 | athlon)
21879 -               basic_machine=i686-pc
21880 +       pentium | p5 | k5 | k6 | nexen)
21881 +               basic_machine=i586-intel
21882                 ;;
21883 +        pentiumpro | p6 | 6x86)
21884 +                basic_machine=i686-pc
21885 +                ;;
21886         pentiumii | pentium2)
21887 -               basic_machine=i686-pc
21888 +               basic_machine=i786-pc
21889                 ;;
21890 -       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
21891 +       pentium-* | p5-* | k5-* | k6-* | nexen-*)
21892                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
21893                 ;;
21894 -       pentiumpro-* | p6-* | 6x86-* | athlon-*)
21895 +       pentiumpro-* | p6-* | 6x86*)
21896                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
21897                 ;;
21898         pentiumii-* | pentium2-*)
21899 -               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
21900 +               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
21901                 ;;
21902         pn)
21903                 basic_machine=pn-gould
21904                 ;;
21905 -       power)  basic_machine=power-ibm
21906 +       power)  basic_machine=rs6000-ibm
21907                 ;;
21908         ppc)    basic_machine=powerpc-unknown
21909 -               ;;
21910 +               ;;
21911         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
21912                 ;;
21913         ppcle | powerpclittle | ppc-le | powerpc-little)
21914                 basic_machine=powerpcle-unknown
21915 -               ;;
21916 +               ;;
21917         ppcle-* | powerpclittle-*)
21918                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
21919                 ;;
21920 -       ppc64)  basic_machine=powerpc64-unknown
21921 -               ;;
21922 -       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
21923 -               ;;
21924 -       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
21925 -               basic_machine=powerpc64le-unknown
21926 -               ;;
21927 -       ppc64le-* | powerpc64little-*)
21928 -               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
21929 -               ;;
21930         ps2)
21931                 basic_machine=i386-ibm
21932                 ;;
21933 -       pw32)
21934 -               basic_machine=i586-unknown
21935 -               os=-pw32
21936 -               ;;
21937 -       rom68k)
21938 -               basic_machine=m68k-rom68k
21939 -               os=-coff
21940 -               ;;
21941 +        rom68k)
21942 +                basic_machine=m68k-rom68k
21943 +                os=-coff
21944 +                ;;
21945         rm[46]00)
21946                 basic_machine=mips-siemens
21947                 ;;
21948         rtpc | rtpc-*)
21949                 basic_machine=romp-ibm
21950                 ;;
21951 -       s390 | s390-*)
21952 +       s390-*)
21953                 basic_machine=s390-ibm
21954 -               ;;
21955 -       s390x | s390x-*)
21956 -               basic_machine=s390x-ibm
21957 -               ;;
21958 -       sa29200)
21959 -               basic_machine=a29k-amd
21960 -               os=-udi
21961 +               os=-linux
21962                 ;;
21963 +        sa29200)
21964 +                basic_machine=a29k-amd
21965 +                os=-udi
21966 +                ;;
21967         sequent)
21968                 basic_machine=i386-sequent
21969                 ;;
21970 @@ -808,24 +691,24 @@ case $basic_machine in
21971                 basic_machine=sh-hitachi
21972                 os=-hms
21973                 ;;
21974 -       sparclite-wrs | simso-wrs)
21975 -               basic_machine=sparclite-wrs
21976 -               os=-vxworks
21977 -               ;;
21978 +        sparclite-wrs)
21979 +                basic_machine=sparclite-wrs
21980 +                os=-vxworks
21981 +                ;;
21982         sps7)
21983                 basic_machine=m68k-bull
21984                 os=-sysv2
21985                 ;;
21986         spur)
21987                 basic_machine=spur-unknown
21988 -               ;;
21989 -       st2000)
21990 -               basic_machine=m68k-tandem
21991                 ;;
21992 -       stratus)
21993 -               basic_machine=i860-stratus
21994 -               os=-sysv4
21995 -               ;;
21996 +        st2000)
21997 +                basic_machine=m68k-tandem
21998 +                ;;
21999 +        stratus)
22000 +                basic_machine=i860-stratus
22001 +                os=-sysv4
22002 +                ;;
22003         sun2)
22004                 basic_machine=m68000-sun
22005                 ;;
22006 @@ -866,40 +749,20 @@ case $basic_machine in
22007         sun386 | sun386i | roadrunner)
22008                 basic_machine=i386-sun
22009                 ;;
22010 -        sv1)
22011 -               basic_machine=sv1-cray
22012 -               os=-unicos
22013 -               ;;
22014         symmetry)
22015                 basic_machine=i386-sequent
22016                 os=-dynix
22017                 ;;
22018 -       t3d)
22019 -               basic_machine=alpha-cray
22020 -               os=-unicos
22021 -               ;;
22022 -       t3e)
22023 -               basic_machine=alphaev5-cray
22024 -               os=-unicos
22025 -               ;;
22026 -       t90)
22027 -               basic_machine=t90-cray
22028 -               os=-unicos
22029 -               ;;
22030 -       tic54x | c54x*)
22031 -               basic_machine=tic54x-unknown
22032 -               os=-coff
22033 -               ;;
22034 -       tx39)
22035 -               basic_machine=mipstx39-unknown
22036 -               ;;
22037 -       tx39el)
22038 -               basic_machine=mipstx39el-unknown
22039 -               ;;
22040 -       toad1)
22041 -               basic_machine=pdp10-xkl
22042 -               os=-tops20
22043 -               ;;
22044 +        t3e)
22045 +                basic_machine=t3e-cray
22046 +                os=-unicos
22047 +                ;;
22048 +        tx39)
22049 +                basic_machine=mipstx39-unknown
22050 +                ;;
22051 +        tx39el)
22052 +                basic_machine=mipstx39el-unknown
22053 +                ;;
22054         tower | tower-32)
22055                 basic_machine=m68k-ncr
22056                 ;;
22057 @@ -911,10 +774,18 @@ case $basic_machine in
22058                 basic_machine=a29k-nyu
22059                 os=-sym1
22060                 ;;
22061 -       v810 | necv810)
22062 -               basic_machine=v810-nec
22063 -               os=-none
22064 +       uw2 | unixware | unixware2)
22065 +               basic_machine=i386-pc
22066 +               os=-sysv4.2uw2.1
22067                 ;;
22068 +       uw7 | unixware7)
22069 +               basic_machine=i386-pc
22070 +               os=-sysv5uw7
22071 +               ;;
22072 +        v810 | necv810)
22073 +                basic_machine=v810-nec
22074 +                os=-none
22075 +                ;;
22076         vaxv)
22077                 basic_machine=vax-dec
22078                 os=-sysv
22079 @@ -924,8 +795,8 @@ case $basic_machine in
22080                 os=-vms
22081                 ;;
22082         vpp*|vx|vx-*)
22083 -               basic_machine=f301-fujitsu
22084 -               ;;
22085 +               basic_machine=f301-fujitsu
22086 +               ;;
22087         vxworks960)
22088                 basic_machine=i960-wrs
22089                 os=-vxworks
22090 @@ -937,30 +808,26 @@ case $basic_machine in
22091         vxworks29k)
22092                 basic_machine=a29k-wrs
22093                 os=-vxworks
22094 -               ;;
22095 -       w65*)
22096 -               basic_machine=w65-wdc
22097 -               os=-none
22098 -               ;;
22099 -       w89k-*)
22100 -               basic_machine=hppa1.1-winbond
22101 -               os=-proelf
22102 -               ;;
22103 -       windows32)
22104 -               basic_machine=i386-pc
22105 -               os=-windows32-msvcrt
22106                 ;;
22107 -        xps | xps100)
22108 -               basic_machine=xps100-honeywell
22109 -               ;;
22110 -       ymp)
22111 -               basic_machine=ymp-cray
22112 +        w65*)
22113 +                basic_machine=w65-wdc
22114 +                os=-none
22115 +                ;;
22116 +        w89k-*)
22117 +                basic_machine=hppa1.1-winbond
22118 +                os=-proelf
22119 +                ;;
22120 +       xmp)
22121 +               basic_machine=xmp-cray
22122                 os=-unicos
22123                 ;;
22124 -       z8k-*-coff)
22125 -               basic_machine=z8k-unknown
22126 -               os=-sim
22127 +       xps | xps100)
22128 +               basic_machine=xps100-honeywell
22129                 ;;
22130 +        z8k-*-coff)
22131 +                basic_machine=z8k-unknown
22132 +                os=-sim
22133 +                ;;
22134         none)
22135                 basic_machine=none-none
22136                 os=-none
22137 @@ -968,14 +835,21 @@ case $basic_machine in
22139  # Here we handle the default manufacturer of certain CPU types.  It is in
22140  # some cases the only manufacturer, in others, it is the most popular.
22141 -       w89k)
22142 -               basic_machine=hppa1.1-winbond
22143 -               ;;
22144 -       op50n)
22145 -               basic_machine=hppa1.1-oki
22146 -               ;;
22147 -       op60c)
22148 -               basic_machine=hppa1.1-oki
22149 +        w89k)
22150 +                basic_machine=hppa1.1-winbond
22151 +                ;;
22152 +        op50n)
22153 +                basic_machine=hppa1.1-oki
22154 +                ;;
22155 +        op60c)
22156 +                basic_machine=hppa1.1-oki
22157 +                ;;
22158 +       mips)
22159 +               if test "x$os" = "x-linux-gnu" ; then
22160 +                       basic_machine=mips-unknown
22161 +               else
22162 +                       basic_machine=mips-mips
22163 +               fi
22164                 ;;
22165         romp)
22166                 basic_machine=romp-ibm
22167 @@ -986,26 +860,16 @@ case $basic_machine in
22168         vax)
22169                 basic_machine=vax-dec
22170                 ;;
22171 -       pdp10)
22172 -               # there are many clones, so DEC is not a safe bet
22173 -               basic_machine=pdp10-unknown
22174 -               ;;
22175         pdp11)
22176                 basic_machine=pdp11-dec
22177                 ;;
22178         we32k)
22179                 basic_machine=we32k-att
22180 -               ;;
22181 -       sh3 | sh4 | sh3eb | sh4eb)
22182 -               basic_machine=sh-unknown
22183 -               ;;
22184 -       sh64)
22185 -               basic_machine=sh64-unknown
22186                 ;;
22187 -       sparc | sparcv9 | sparcv9b)
22188 +       sparc | sparcv9)
22189                 basic_machine=sparc-sun
22190                 ;;
22191 -        cydra)
22192 +       cydra)
22193                 basic_machine=cydra-cydrome
22194                 ;;
22195         orion)
22196 @@ -1014,19 +878,16 @@ case $basic_machine in
22197         orion105)
22198                 basic_machine=clipper-highlevel
22199                 ;;
22200 -       mac | mpw | mac-mpw)
22201 -               basic_machine=m68k-apple
22202 -               ;;
22203 -       pmac | pmac-mpw)
22204 -               basic_machine=powerpc-apple
22205 -               ;;
22206 -       c4x*)
22207 -               basic_machine=c4x-none
22208 -               os=-coff
22209 -               ;;
22210 -       *-unknown)
22211 -               # Make sure to match an already-canonicalized machine name.
22212 -               ;;
22213 +        mac | mpw | mac-mpw)
22214 +                basic_machine=m68k-apple
22215 +                ;;
22216 +        pmac | pmac-mpw)
22217 +                basic_machine=powerpc-apple
22218 +                ;;
22219 +        c4x*)
22220 +                basic_machine=c4x-none
22221 +                os=-coff
22222 +                ;;
22223         *)
22224                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
22225                 exit 1
22226 @@ -1050,8 +911,8 @@ esac
22227  if [ x"$os" != x"" ]
22228  then
22229  case $os in
22230 -        # First match some system type aliases
22231 -        # that might get confused with valid system types.
22232 +       # First match some system type aliases
22233 +       # that might get confused with valid system types.
22234         # -solaris* is a basic system type, with this one exception.
22235         -solaris1 | -solaris1.*)
22236                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
22237 @@ -1061,9 +922,15 @@ case $os in
22238                 ;;
22239         -svr4*)
22240                 os=-sysv4
22241 +               ;;
22242 +       -unixware | -uw | -unixware2* | -uw2*)
22243 +               os=-sysv4.2uw2.1
22244 +               ;;
22245 +       -unixware7* | -uw7*)
22246 +               os=-sysv5uw7
22247                 ;;
22248 -       -unixware*)
22249 -               os=-sysv4.2uw
22250 +        -unixware*)
22251 +                os=-sysv4.2uw
22252                 ;;
22253         -gnu/linux*)
22254                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
22255 @@ -1083,35 +950,23 @@ case $os in
22256               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
22257               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
22258               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
22259 -             | -chorusos* | -chorusrdb* \
22260               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
22261               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
22262 -             | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
22263 -             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
22264 -             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
22265 -             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
22266 -             | -morphos* | -superux* | -rtmk* | -rtmk-nova*)
22267 +             | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*)
22268         # Remember, each alternative MUST END IN *, to match a version number.
22269                 ;;
22270 -       -qnx*)
22271 -               case $basic_machine in
22272 -                   x86-* | i*86-*)
22273 -                       ;;
22274 -                   *)
22275 -                       os=-nto$os
22276 -                       ;;
22277 -               esac
22278 -               ;;
22279 -       -nto*)
22280 -               os=-nto-qnx
22281 -               ;;
22282 -       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
22283 -             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
22284 -             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
22285 +       # BEGIN CASES ADDED FOR Bash
22286 +       -qnx* | -powerux* | -superux* | -darwin* | -nonstopux*)
22287                 ;;
22288 -       -mac*)
22289 -               os=`echo $os | sed -e 's|mac|macos|'`
22290 -               ;;
22291 +       # END CASES ADDED FOR Bash
22292 +        -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
22293 +              | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
22294 +              | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
22295 +                ;;
22296 +        -mac*)
22297 +                os=`echo $os | sed -e 's|mac|macos|'`
22298 +                ;;
22300         -linux*)
22301                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
22302                 ;;
22303 @@ -1121,12 +976,6 @@ case $os in
22304         -sunos6*)
22305                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
22306                 ;;
22307 -       -opened*)
22308 -               os=-openedition
22309 -               ;;
22310 -       -wince*)
22311 -               os=-wince
22312 -               ;;
22313         -osfrose*)
22314                 os=-osfrose
22315                 ;;
22316 @@ -1141,25 +990,16 @@ case $os in
22317                 ;;
22318         -acis*)
22319                 os=-aos
22320 -               ;;
22321 -       -atheos*)
22322 -               os=-atheos
22323                 ;;
22324 -       -386bsd)
22325 -               os=-bsd
22326 -               ;;
22327 +        -386bsd)
22328 +                os=-bsd
22329 +                ;;
22330         -ctix* | -uts*)
22331                 os=-sysv
22332                 ;;
22333 -       -nova*)
22334 -               os=-rtmk-nova
22335 -               ;;
22336         -ns2 )
22337 -               os=-nextstep2
22338 +               os=-nextstep2
22339                 ;;
22340 -       -nsk*)
22341 -               os=-nsk
22342 -               ;;
22343         # Preserve the version number of sinix5.
22344         -sinix5.*)
22345                 os=`echo $os | sed -e 's|sinix|sysv|'`
22346 @@ -1181,22 +1021,25 @@ case $os in
22347                 ;;
22348         -sysvr4)
22349                 os=-sysv4
22350 -               ;;
22351 -       # This must come after -sysvr4.
22352 -       -sysv*)
22353                 ;;
22354 -       -ose*)
22355 -               os=-ose
22356 +       -sysvr5)
22357 +               os=-sysv5
22358                 ;;
22359 -       -es1800*)
22360 -               os=-ose
22361 +       # This must come after -sysvr[45].
22362 +       -sysv*)
22363                 ;;
22364 +        -ose*)
22365 +                os=-ose
22366 +                ;;
22367 +        -es1800*)
22368 +                os=-ose
22369 +                ;;
22370         -xenix)
22371                 os=-xenix
22372                 ;;
22373 -        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
22374 -               os=-mint
22375 -               ;;
22376 +        -*mint | -*MiNT)
22377 +                os=-mint
22378 +                ;;
22379         -none)
22380                 ;;
22381         *)
22382 @@ -1222,17 +1065,10 @@ case $basic_machine in
22383         *-acorn)
22384                 os=-riscix1.2
22385                 ;;
22386 -       arm*-rebel)
22387 -               os=-linux
22388 -               ;;
22389         arm*-semi)
22390                 os=-aout
22391                 ;;
22392 -       # This must come before the *-dec entry.
22393 -       pdp10-*)
22394 -               os=-tops20
22395 -               ;;
22396 -        pdp11-*)
22397 +       pdp11-*)
22398                 os=-none
22399                 ;;
22400         *-dec | vax-*)
22401 @@ -1249,19 +1085,16 @@ case $basic_machine in
22402                 # This also exists in the configure program, but was not the
22403                 # default.
22404                 # os=-sunos4
22405 -               ;;
22406 -       m68*-cisco)
22407 -               os=-aout
22408                 ;;
22409 -       mips*-cisco)
22410 -               os=-elf
22411 -               ;;
22412 -       mips*-*)
22413 -               os=-elf
22414 -               ;;
22415 -       or32-*)
22416 -               os=-coff
22417 -               ;;
22418 +        m68*-cisco)
22419 +                os=-aout
22420 +                ;;
22421 +        mips*-cisco)
22422 +                os=-elf
22423 +                ;;
22424 +        mips*-*)
22425 +                os=-elf
22426 +                ;;
22427         *-tti)  # must be before sparc entry or we get the wrong os.
22428                 os=-sysv3
22429                 ;;
22430 @@ -1273,16 +1106,16 @@ case $basic_machine in
22431                 ;;
22432         *-ibm)
22433                 os=-aix
22434 -               ;;
22435 -       *-wec)
22436 -               os=-proelf
22437 -               ;;
22438 -       *-winbond)
22439 -               os=-proelf
22440                 ;;
22441 -       *-oki)
22442 -               os=-proelf
22443 -               ;;
22444 +        *-wec)
22445 +                os=-proelf
22446 +                ;;
22447 +        *-winbond)
22448 +                os=-proelf
22449 +                ;;
22450 +        *-oki)
22451 +                os=-proelf
22452 +                ;;
22453         *-hp)
22454                 os=-hpux
22455                 ;;
22456 @@ -1325,39 +1158,39 @@ case $basic_machine in
22457         *-next)
22458                 os=-nextstep3
22459                 ;;
22460 -        *-gould)
22461 +       *-gould)
22462                 os=-sysv
22463                 ;;
22464 -        *-highlevel)
22465 +       *-highlevel)
22466                 os=-bsd
22467                 ;;
22468         *-encore)
22469                 os=-bsd
22470                 ;;
22471 -        *-sgi)
22472 +       *-sgi)
22473                 os=-irix
22474                 ;;
22475 -        *-siemens)
22476 +       *-siemens)
22477                 os=-sysv4
22478                 ;;
22479         *-masscomp)
22480                 os=-rtu
22481                 ;;
22482 -       f30[01]-fujitsu | f700-fujitsu)
22483 +       f301-fujitsu)
22484                 os=-uxpv
22485 -               ;;
22486 -       *-rom68k)
22487 -               os=-coff
22488 -               ;;
22489 -       *-*bug)
22490 -               os=-coff
22491 -               ;;
22492 -       *-apple)
22493 -               os=-macos
22494 -               ;;
22495 -       *-atari*)
22496 -               os=-mint
22497                 ;;
22498 +        *-rom68k)
22499 +                os=-coff
22500 +                ;;
22501 +        *-*bug)
22502 +                os=-coff
22503 +                ;;
22504 +        *-apple)
22505 +                os=-macos
22506 +                ;;
22507 +        *-atari*)
22508 +                os=-mint
22509 +                ;;
22510         *)
22511                 os=-none
22512                 ;;
22513 @@ -1376,18 +1209,18 @@ case $basic_machine in
22514                         -sunos*)
22515                                 vendor=sun
22516                                 ;;
22517 +                       -lynxos*)
22518 +                               vendor=lynx
22519 +                               ;;
22520                         -aix*)
22521                                 vendor=ibm
22522 -                               ;;
22523 -                       -beos*)
22524 -                               vendor=be
22525                                 ;;
22526 +                        -beos*)
22527 +                                vendor=be
22528 +                                ;;
22529                         -hpux*)
22530                                 vendor=hp
22531                                 ;;
22532 -                       -mpeix*)
22533 -                               vendor=hp
22534 -                               ;;
22535                         -hiux*)
22536                                 vendor=hitachi
22537                                 ;;
22538 @@ -1403,7 +1236,7 @@ case $basic_machine in
22539                         -genix*)
22540                                 vendor=ns
22541                                 ;;
22542 -                       -mvs* | -opened*)
22543 +                       -mvs*)
22544                                 vendor=ibm
22545                                 ;;
22546                         -ptx*)
22547 @@ -1414,30 +1247,19 @@ case $basic_machine in
22548                                 ;;
22549                         -aux*)
22550                                 vendor=apple
22551 -                               ;;
22552 -                       -hms*)
22553 -                               vendor=hitachi
22554                                 ;;
22555 -                       -mpw* | -macos*)
22556 -                               vendor=apple
22557 -                               ;;
22558 -                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
22559 -                               vendor=atari
22560 -                               ;;
22561 -                       -vos*)
22562 -                               vendor=stratus
22563 -                               ;;
22564 +                        -hms*)
22565 +                                vendor=hitachi
22566 +                                ;;
22567 +                        -mpw* | -macos*)
22568 +                                vendor=apple
22569 +                                ;;
22570 +                        -*mint | -*MiNT)
22571 +                                vendor=atari
22572 +                                ;;
22573                 esac
22574                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
22575                 ;;
22576  esac
22578  echo $basic_machine$os
22579 -exit 0
22581 -# Local variables:
22582 -# eval: (add-hook 'write-file-hooks 'time-stamp)
22583 -# time-stamp-start: "timestamp='"
22584 -# time-stamp-format: "%:y-%02m-%02d"
22585 -# time-stamp-end: "'"
22586 -# End:
22587 Index: readline/support/shlib-install
22588 ===================================================================
22589 RCS file: /prjz/.cvsroot/gdb/readline/support/shlib-install,v
22590 retrieving revision 1.1.1.1
22591 diff -u -3 -p -r1.1.1.1 shlib-install
22592 --- readline/support/shlib-install      2003/02/16 21:36:34     1.1.1.1
22593 +++ readline/support/shlib-install      2000/09/12 14:26:14
22594 @@ -66,7 +66,7 @@ fi
22595  # HP-UX requires that a shared library have execute permission
22596  case "$host_os" in
22597  hpux*) if [ -z "$uninstall" ]; then
22598 -               chmod 755 ${INSTALLDIR}/${LIBNAME}
22599 +               chmod 555 ${INSTALLDIR}/${LIBNAME}
22600         fi ;;
22601  *)     ;;
22602  esac
22603 @@ -84,6 +84,9 @@ case "$LIBNAME" in
22604         ;;
22605  esac
22607 +INSTALL_LINK1='cd $INSTALLDIR ; ln -s $LIBNAME $LINK1'
22608 +INSTALL_LINK2='cd $INSTALLDIR ; ln -s $LIBNAME $LINK2'
22611  # Create symlinks to the installed library.  This section is incomplete.
22613 @@ -92,13 +95,13 @@ case "$host_os" in
22614         # libname.so.M -> libname.so.M.N
22615         ${echo} ${RM} ${INSTALLDIR}/$LINK2
22616         if [ -z "$uninstall" ]; then
22617 -               ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2
22618 +               ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK2
22619         fi
22621         # libname.so -> libname.so.M.N
22622         ${echo} ${RM} ${INSTALLDIR}/$LINK1
22623         if [ -z "$uninstall" ]; then
22624 -               ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
22625 +               ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
22626         fi
22627         ;;
22629 @@ -106,7 +109,7 @@ solaris2*|aix4.[2-9]*|osf*|irix[56]*)
22630         # libname.so -> libname.so.M
22631         ${echo} ${RM} ${INSTALLDIR}/$LINK1
22632         if [ -z "$uninstall" ]; then
22633 -               ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
22634 +               ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
22635         fi
22636         ;;
22638 @@ -117,19 +120,19 @@ freebsd3*)
22639                 # libname.so -> libname.so.M
22640                 ${echo} ${RM} ${INSTALLDIR}/$LINK1
22641                 if [ -z "$uninstall" ]; then
22642 -                       ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
22643 +                       ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
22644                 fi
22645         else
22646                 # libname.so.M -> libname.so.M.N
22647                 ${echo} ${RM} ${INSTALLDIR}/$LINK2
22648                 if [ -z "$uninstall" ]; then
22649 -                       ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK2
22650 +                       ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK2
22651                 fi
22653                 # libname.so -> libname.so.M.N
22654                 ${echo} ${RM} ${INSTALLDIR}/$LINK1
22655                 if [ -z "$uninstall" ]; then
22656 -                       ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/$LINK1
22657 +                       ${echo} ln -s $LIBNAME ${INSTALLDIR}/$LINK1
22658                 fi
22659         fi
22660         ;;
22661 @@ -138,7 +141,8 @@ hpux1*)
22662         # libname.sl -> libname.M
22663         ${echo} ${RM} ${INSTALLDIR}/$LINK1.sl
22664         if [ -z "$uninstall" ]; then
22665 -               ${echo} ln -s $INSTALLDIR/$LIBNAME ${INSTALLDIR}/${LINK1}.sl
22666 +#              ${echo} ln -s $LIBNAME ${INSTALLDIR}/${LINK1}.sl
22667 +               ${echo} ln -s $LIBNAME ${INSTALLDIR}/${LINK1}
22668         fi
22669         ;;
22671 Index: readline/support/shobj-conf
22672 ===================================================================
22673 RCS file: /prjz/.cvsroot/gdb/readline/support/shobj-conf,v
22674 retrieving revision 1.1.1.1
22675 diff -u -3 -p -r1.1.1.1 shobj-conf
22676 --- readline/support/shobj-conf 2003/02/16 21:36:34     1.1.1.1
22677 +++ readline/support/shobj-conf 2001/01/02 16:15:44
22678 @@ -43,7 +43,7 @@ while [ $# -gt 0 ]; do
22679  done
22681  case "${host_os}-${SHOBJ_CC}" in
22682 -sunos4*-gcc*)
22683 +sunos4*-*gcc*)
22684         SHOBJ_CFLAGS=-fpic
22685         SHOBJ_LD=/usr/bin/ld
22686         SHOBJ_LDFLAGS='-assert pure-text'
22687 @@ -59,7 +59,7 @@ sunos4*)
22688         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
22689         ;;
22691 -sunos5*-gcc*|solaris2*-gcc*)
22692 +sunos5*-*gcc*|solaris2*-*gcc*)
22693         SHOBJ_CFLAGS=-fpic
22694         SHOBJ_LD='${CC}'
22695         SHOBJ_LDFLAGS='-shared -Wl,-i -Wl,-h,$@'
22696 @@ -97,7 +97,7 @@ freebsd2* | netbsd* | openbsd*)
22697  #      ;;
22699  # FreeBSD-3.x ELF
22700 -freebsd3*)
22701 +freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*)
22702         SHOBJ_CFLAGS=-fpic
22703         SHOBJ_LD='${CC}'
22705 @@ -113,13 +113,13 @@ freebsd3*)
22706                 SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
22707         fi
22708         ;;
22710 -linux*)
22711 +# All versions of Linux or the semi-mythical GNU Hurd.
22712 +linux*|gnu*)
22713         SHOBJ_CFLAGS=-fPIC
22714         SHOBJ_LD='${CC}'
22715         SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
22717 -       SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
22718 +       SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
22719         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
22720         ;;
22722 @@ -158,10 +158,11 @@ bsdi4*)
22723         SHOBJ_LD='${CC}'
22724         SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
22726 +       SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
22727         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
22728         ;;
22730 -osf*-gcc*)
22731 +osf*-*gcc*)
22732         # Fix to use gcc linker driver from bfischer@TechFak.Uni-Bielefeld.DE
22733         SHOBJ_LD='${CC}'
22734         SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
22735 @@ -178,7 +179,7 @@ osf*)
22736         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
22737         ;;
22739 -aix4.[2-9]*-gcc*)              # lightly tested by jik@cisco.com
22740 +aix4.[2-9]*-*gcc*)             # lightly tested by jik@cisco.com
22741         SHOBJ_CFLAGS=-fpic
22742         SHOBJ_LD='ld'
22743         SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
22744 @@ -203,7 +204,7 @@ aix4.[2-9]*)
22746  # THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
22748 -irix[56]*-gcc*)
22749 +irix[56]*-*gcc*)
22750         SHOBJ_CFLAGS='-fpic'
22751         SHOBJ_LD='${CC}'
22752         SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
22753 @@ -216,14 +217,15 @@ irix[56]*)
22754         SHOBJ_CFLAGS='-K PIC'
22755         SHOBJ_LD=ld
22756  #      SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
22757 -#      Change from David Kaelbling <drk@sgi.com>
22758 +#      Change from David Kaelbling <drk@sgi.com>.  If you have problems,
22759 +#      remove the `-no_unresolved'
22760         SHOBJ_LDFLAGS='-shared -no_unresolved -soname $@'
22762         SHLIB_XLDFLAGS='-rpath $(libdir)'
22763         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
22764         ;;
22766 -hpux9*-gcc*)
22767 +hpux9*-*gcc*)
22768         # must use gcc; the bundled cc cannot compile PIC code
22769         SHOBJ_CFLAGS='-fpic'
22770         SHOBJ_LD='${CC}'
22771 @@ -239,7 +241,7 @@ hpux9*)
22772         SHLIB_STATUS=unsupported
22773         ;;
22775 -hpux10*-gcc*)
22776 +hpux10*-*gcc*)
22777         # must use gcc; the bundled cc cannot compile PIC code
22778         SHOBJ_CFLAGS='-fpic'
22779         SHOBJ_LD='${CC}'
22780 @@ -253,14 +255,27 @@ hpux10*-gcc*)
22781  hpux10*)
22782         SHOBJ_STATUS=unsupported
22783         SHLIB_STATUS=unsupported
22785 +       # If you are using the HP ANSI C compiler, you can uncomment and use
22786 +       # this code
22787 +#      SHOBJ_STATUS=unsupported
22788 +#      SHLIB_STATUS=unsupported
22790 +#      SHOBJ_CFLAGS='+z'
22791 +#      SHOBJ_LD='ld'
22792 +#      SHOBJ_LDFLAGS='-b'
22794 +#      SHLIB_XLDFLAGS=''
22795 +#      SHLIB_LIBSUFF='sl'
22796 +#      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
22797         ;;
22799 -hpux11*-gcc*)
22800 +hpux11*-*gcc*)
22801         # must use gcc; the bundled cc cannot compile PIC code
22802         SHOBJ_CFLAGS='-fpic'
22803         SHOBJ_LD='${CC}'
22804  #      SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
22805 -       SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s -Wl,+h,$@'
22806 +       SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s -Wl,+h,$@'
22808         SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
22809         SHLIB_LIBSUFF='sl'
22810 @@ -270,9 +285,23 @@ hpux11*-gcc*)
22811  hpux11*)
22812         SHOBJ_STATUS=unsupported
22813         SHLIB_STATUS=unsupported
22815 +       # If you are using the HP ANSI C compiler, you can uncomment and use
22816 +       # this code
22817 +#      SHOBJ_STATUS=unsupported
22818 +#      SHLIB_STATUS=unsupported
22820 +#      SHOBJ_CFLAGS='+z'
22821 +#      SHOBJ_LD='ld'
22822 +#      SHOBJ_LDFLAGS='-b'
22824 +#      SHLIB_XLDFLAGS=''
22825 +#      SHLIB_LIBSUFF='sl'
22826 +#      SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'      
22828         ;;
22830 -sysv4*-gcc*)
22831 +sysv4*-*gcc*)
22832         SHOBJ_CFLAGS=-shared
22833         SHOBJ_LDFLAGS='-shared -h $@'
22834         SHOBJ_LD='${CC}'
22835 @@ -288,7 +317,7 @@ sysv4*)
22836         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
22837         ;;
22839 -sco3.2v5*-gcc*)
22840 +sco3.2v5*-*gcc*)
22841         SHOBJ_CFLAGS='-fpic'            # DEFAULTS TO ELF
22842         SHOBJ_LD='${CC}'
22843         SHOBJ_LDFLAGS='-shared'
22844 @@ -304,7 +333,7 @@ sco3.2v5*)
22845         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
22846         ;;
22848 -sysv5uw7*-gcc*)
22849 +sysv5uw7*-*gcc*)
22850         SHOBJ_CFLAGS='-fpic'
22851         SHOBJ_LD='${CC}'
22852         SHOBJ_LDFLAGS='-shared'
22853 @@ -320,7 +349,7 @@ sysv5uw7*)
22854         SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
22855         ;;
22856         
22857 -dgux*-gcc*)
22858 +dgux*-*gcc*)
22859         SHOBJ_CFLAGS=-fpic
22860         SHOBJ_LD='${CC}'
22861         SHOBJ_LDFLAGS='-shared'
22862 @@ -344,7 +373,7 @@ msdos*)
22864  # Rely on correct gcc configuration for everything else
22866 -*-gcc*)
22867 +*-*gcc*)
22868         SHOBJ_CFLAGS=-fpic
22869         SHOBJ_LD='${CC}'
22870         SHOBJ_LDFLAGS='-shared'